[latex3-commits] [git/LaTeX3-latex3-latex3] gh931-errors-v2: Combine the implementations of warning/note/information messages (bbaef3cde)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Aug 26 10:41:54 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : gh931-errors-v2
Link       : https://github.com/latex3/latex3/commit/bbaef3cde1cebef631e1b19de37222a2dcb8ce1b

>---------------------------------------------------------------

commit bbaef3cde1cebef631e1b19de37222a2dcb8ce1b
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Sun Aug 15 07:05:30 2021 +0200

    Combine the implementations of warning/note/information messages


>---------------------------------------------------------------

bbaef3cde1cebef631e1b19de37222a2dcb8ce1b
 l3kernel/l3msg.dtx | 105 ++++++++++++++++++++---------------------------------
 1 file changed, 39 insertions(+), 66 deletions(-)

diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index d08550273..09e4c7a25 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -1180,6 +1180,7 @@
 %
 % \begin{macro}
 %   {
+%     \@@_info_aux:NNnnnnnn ,
 %     \msg_warning:nnnnnn ,
 %     \msg_warning:nnnnn  ,
 %     \msg_warning:nnnn   ,
@@ -1188,38 +1189,7 @@
 %     \msg_warning:nnxxxx ,
 %     \msg_warning:nnxxx  ,
 %     \msg_warning:nnxx   ,
-%     \msg_warning:nnx
-%   }
-%   Warnings are printed to the terminal.
-%    \begin{macrocode}
-  \@@_class_new:nn { warning }
-    {
-      \str_set:Nx \l_@@_text_str { \msg_warning_text:n {#1} }
-      \str_set:Nx \l_@@_name_str { \msg_module_name:n {#1} }
-      \iow_term:n { }
-      \iow_wrap:nxnN
-        {
-          \l_@@_text_str : ~
-          \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
-        }
-        {
-          ( \l_@@_name_str )
-          \prg_replicate:nn
-            {
-                \str_count:N \l_@@_text_str
-              - \str_count:N \l_@@_name_str
-            }
-            { ~ }
-        }
-        { } \iow_term:n
-      \iow_term:n { }
-    }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}
-%   {
-%     \@@_info_aux:Nnn      ,
+%     \msg_warning:nnx    ,
 %     \msg_note:nnnnnn ,
 %     \msg_note:nnnnn  ,
 %     \msg_note:nnnn   ,
@@ -1237,27 +1207,22 @@
 %     \msg_info:nnxxxx ,
 %     \msg_info:nnxxx  ,
 %     \msg_info:nnxx   ,
-%     \msg_info:nnx
+%     \msg_info:nnx    ,
 %   }
-%   Information has no decoration and goes either to the log or both
-%   log and terminal.
+%   Warnings and information messages have no decoration.  Warnings are
+%   printed to the terminal while information can either go to the log
+%   or both log and terminal.
 %    \begin{macrocode}
-  \@@_class_new:nn { note }
-    {
-      \@@_info_aux:Nnn \iow_term:n {#1}
-        { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
-    }
-  \@@_class_new:nn { info }
+  \cs_new_protected:Npn \@@_info_aux:NNnnnnnn #1#2#3#4#5#6#7#8
     {
-      \@@_info_aux:Nnn \iow_log:n {#1}
-        { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
-    }
-  \cs_new_protected:Npn \@@_info_aux:Nnn #1#2#3
-    {
-      \str_set:Nx \l_@@_text_str { \msg_info_text:n {#2} }
-      \str_set:Nx \l_@@_name_str { \msg_module_name:n {#2} }
+      \str_set:Nx \l_@@_text_str { #2 {#3} }
+      \str_set:Nx \l_@@_name_str { \msg_module_name:n {#3} }
       #1 { }
-      \iow_wrap:nxnN { \l_@@_text_str : ~ #3 }
+      \iow_wrap:nxnN
+        {
+          \l_@@_text_str : ~
+          \use:c { \c_@@_text_prefix_tl #3 / #4 } {#5} {#6} {#7} {#8}
+        }
         {
           ( \l_@@_name_str )
           \prg_replicate:nn
@@ -1270,6 +1235,21 @@
          { } #1
        #1 { }
     }
+  \@@_class_new:nn { warning }
+    {
+      \@@_info_aux:NNnnnnnn \iow_term:n \msg_warning_text:n
+        {#1} {#2} {#3} {#4} {#5} {#6}
+    }
+  \@@_class_new:nn { note }
+    {
+      \@@_info_aux:NNnnnnnn \iow_term:n \msg_info_text:n
+        {#1} {#2} {#3} {#4} {#5} {#6}
+    }
+  \@@_class_new:nn { info }
+    {
+      \@@_info_aux:NNnnnnnn \iow_log:n \msg_info_text:n
+        {#1} {#2} {#3} {#4} {#5} {#6}
+    }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1283,22 +1263,7 @@
 %     \msg_log:nnxxxx ,
 %     \msg_log:nnxxx  ,
 %     \msg_log:nnxx   ,
-%     \msg_log:nnx
-%   }
-%   \enquote{Log} data is very similar to information, but with no extras
-%   added.
-%    \begin{macrocode}
-  \@@_class_new:nn { log }
-    {
-      \iow_wrap:nnnN
-        { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
-        { } { } \iow_log:n
-    }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}
-%   {
+%     \msg_log:nnx    ,
 %     \msg_term:nnnnnn ,
 %     \msg_term:nnnnn  ,
 %     \msg_term:nnnn   ,
@@ -1307,12 +1272,20 @@
 %     \msg_term:nnxxxx ,
 %     \msg_term:nnxxx  ,
 %     \msg_term:nnxx   ,
-%     \msg_term:nnx
+%     \msg_term:nnx    ,
 %   }
+%   \enquote{Log} data is very similar to information, but with no extras
+%   added.
 %   \enquote{Term} is used for communicating with the user through the
 %   terminal, like diagnostic messages, and debugging.  This is similar
 %   to \enquote{log} messages, but uses the terminal output.
 %    \begin{macrocode}
+  \@@_class_new:nn { log }
+    {
+      \iow_wrap:nnnN
+        { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
+        { } { } \iow_log:n
+    }
   \@@_class_new:nn { term }
     {
       \iow_wrap:nnnN





More information about the latex3-commits mailing list.