[latex3-commits] [git/LaTeX3-latex3-latex3] msg_expandable_error: Move \msg_expandable_error:nn(nnnn) to stable (25cbc971d)

PhelypeOleinik tex.phelype at gmail.com
Mon Jun 15 16:20:08 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : msg_expandable_error
Link       : https://github.com/latex3/latex3/commit/25cbc971d7aa6862e830f36cd98797b3ee4636df

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

commit 25cbc971d7aa6862e830f36cd98797b3ee4636df
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Mon Jun 15 11:20:08 2020 -0300

    Move \msg_expandable_error:nn(nnnn) to stable


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

25cbc971d7aa6862e830f36cd98797b3ee4636df
 l3kernel/CHANGELOG.md     |  3 ++
 l3kernel/l3candidates.dtx | 88 ---------------------------------------------
 l3kernel/l3msg.dtx        | 90 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+), 88 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index fce45da35..15447ebd3 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Moved `\msg_expandable_error:nn(nnnn)` to stable.
+
 ## [2020-06-03]
 
 ### Added
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 5b9533868..23c9fb47d 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -268,44 +268,6 @@
 %
 % \section{Additions to \pkg{l3msg}}
 %
-% In very rare cases it may be necessary to produce errors in an
-% expansion-only context.  The functions in this section should only be
-% used if there is no alternative approach using \cs{msg_error:nnnnnn}
-% or other non-expandable commands from the previous section.  Despite
-% having a similar interface as non-expandable messages, expandable
-% errors must be handled internally very differently from normal error
-% messages, as none of the tools to print to the terminal or the log
-% file are expandable.  As a result, short-hands such as |\{| or |\\| do
-% not work, and messages must be very short (with default settings,
-% they are truncated after approximately 50 characters).  It is
-% advisable to ensure that the message is understandable even when
-% truncated, by putting the most important information up front.
-% Another particularity of expandable messages is that they
-% cannot be redirected or turned off by the user.
-%
-% \begin{function}[EXP, added = 2015-08-06, updated = 2019-02-28]
-%   {
-%     \msg_expandable_error:nnnnnn ,
-%     \msg_expandable_error:nnnnn  ,
-%     \msg_expandable_error:nnnn   ,
-%     \msg_expandable_error:nnn    ,
-%     \msg_expandable_error:nn     ,
-%     \msg_expandable_error:nnffff ,
-%     \msg_expandable_error:nnfff  ,
-%     \msg_expandable_error:nnff   ,
-%     \msg_expandable_error:nnf    ,
-%   }
-%   \begin{syntax}
-%     \cs{msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
-%   \end{syntax}
-%   Issues an \enquote{Undefined error} message from \TeX{} itself
-%   using the undefined control sequence \cs{::error} then prints
-%   \enquote{! \meta{module}: }\meta{error message}, which should be
-%   short.  With default settings, anything beyond approximately $60$
-%   characters long (or bytes in some engines) is cropped.  A leading
-%   space might be removed as well.
-% \end{function}
-%
 % \begin{function}[added = 2017-12-04]{\msg_show_eval:Nn, \msg_log_eval:Nn}
 %   \begin{syntax}
 %     \cs{msg_show_eval:Nn} \meta{function} \Arg{expression}
@@ -958,56 +920,6 @@
 %<@@=msg>
 %    \end{macrocode}
 %
-% \begin{macro}[EXP]
-%   {
-%     \msg_expandable_error:nnnnnn ,
-%     \msg_expandable_error:nnnnn  ,
-%     \msg_expandable_error:nnnn   ,
-%     \msg_expandable_error:nnn    ,
-%     \msg_expandable_error:nn     ,
-%     \msg_expandable_error:nnffff ,
-%     \msg_expandable_error:nnfff  ,
-%     \msg_expandable_error:nnff   ,
-%     \msg_expandable_error:nnf
-%   }
-% \begin{macro}{\@@_expandable_error_module:nn}
-%   Pass to an auxiliary the message to display and the module name
-%    \begin{macrocode}
-\cs_new:Npn \msg_expandable_error:nnnnnn #1#2#3#4#5#6
-  {
-    \exp_args:Ne \@@_expandable_error_module:nn
-      {
-        \exp_args:Nc \exp_args:Noooo
-          { \c_@@_text_prefix_tl #1 / #2 }
-          { \tl_to_str:n {#3} }
-          { \tl_to_str:n {#4} }
-          { \tl_to_str:n {#5} }
-          { \tl_to_str:n {#6} }
-      }
-      {#1}
-  }
-\cs_new:Npn \msg_expandable_error:nnnnn #1#2#3#4#5
-  { \msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} {#5} { } }
-\cs_new:Npn \msg_expandable_error:nnnn #1#2#3#4
-  { \msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} { } { } }
-\cs_new:Npn \msg_expandable_error:nnn #1#2#3
-  { \msg_expandable_error:nnnnnn {#1} {#2} {#3} { } { } { } }
-\cs_new:Npn \msg_expandable_error:nn #1#2
-  { \msg_expandable_error:nnnnnn {#1} {#2} { } { } { } { } }
-\cs_generate_variant:Nn \msg_expandable_error:nnnnnn { nnffff }
-\cs_generate_variant:Nn \msg_expandable_error:nnnnn  { nnfff }
-\cs_generate_variant:Nn \msg_expandable_error:nnnn   { nnff }
-\cs_generate_variant:Nn \msg_expandable_error:nnn    { nnf }
-\cs_new:Npn \@@_expandable_error_module:nn #1#2
-  {
-    \exp_after:wN \exp_after:wN
-    \exp_after:wN \@@_use_none_delimit_by_s_stop:w
-    \use:n { \::error ! ~ #2 : ~ #1 } \s_@@_stop
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
 % \begin{macro}{\msg_show_eval:Nn, \msg_log_eval:Nn, \@@_show_eval:nnN}
 %   A short-hand used for \cs{int_show:n} and similar functions that
 %   passes to \cs{tl_show:n} the result of applying |#1| (a
diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index af1e78d3e..905c89fe8 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -423,6 +423,46 @@
 %   all (see the discussion of message redirection).
 % \end{function}
 %
+% \subsection{Expandable error messages}
+%
+% In very rare cases it may be necessary to produce errors in an
+% expansion-only context.  The functions in this section should only be
+% used if there is no alternative approach using \cs{msg_error:nnnnnn}
+% or other non-expandable commands from the previous section.  Despite
+% having a similar interface as non-expandable messages, expandable
+% errors must be handled internally very differently from normal error
+% messages, as none of the tools to print to the terminal or the log
+% file are expandable.  As a result, short-hands such as |\{| or |\\| do
+% not work, and messages must be very short (with default settings,
+% they are truncated after approximately 50 characters).  It is
+% advisable to ensure that the message is understandable even when
+% truncated, by putting the most important information up front.
+% Another particularity of expandable messages is that they
+% cannot be redirected or turned off by the user.
+%
+% \begin{function}[EXP, added = 2015-08-06, updated = 2019-02-28]
+%   {
+%     \msg_expandable_error:nnnnnn ,
+%     \msg_expandable_error:nnnnn  ,
+%     \msg_expandable_error:nnnn   ,
+%     \msg_expandable_error:nnn    ,
+%     \msg_expandable_error:nn     ,
+%     \msg_expandable_error:nnffff ,
+%     \msg_expandable_error:nnfff  ,
+%     \msg_expandable_error:nnff   ,
+%     \msg_expandable_error:nnf    ,
+%   }
+%   \begin{syntax}
+%     \cs{msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
+%   \end{syntax}
+%   Issues an \enquote{Undefined error} message from \TeX{} itself
+%   using the undefined control sequence \cs{::error} then prints
+%   \enquote{! \meta{module}: }\meta{error message}, which should be
+%   short.  With default settings, anything beyond approximately $60$
+%   characters long (or bytes in some engines) is cropped.  A leading
+%   space might be removed as well.
+% \end{function}
+%
 % \section{Redirecting messages}
 %
 % Each message has a \enquote{name}, which can be used to alter the behaviour
@@ -2098,6 +2138,56 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}[EXP]
+%   {
+%     \msg_expandable_error:nnnnnn ,
+%     \msg_expandable_error:nnnnn  ,
+%     \msg_expandable_error:nnnn   ,
+%     \msg_expandable_error:nnn    ,
+%     \msg_expandable_error:nn     ,
+%     \msg_expandable_error:nnffff ,
+%     \msg_expandable_error:nnfff  ,
+%     \msg_expandable_error:nnff   ,
+%     \msg_expandable_error:nnf
+%   }
+% \begin{macro}{\@@_expandable_error_module:nn}
+%   Pass to an auxiliary the message to display and the module name
+%    \begin{macrocode}
+\cs_new:Npn \msg_expandable_error:nnnnnn #1#2#3#4#5#6
+  {
+    \exp_args:Ne \@@_expandable_error_module:nn
+      {
+        \exp_args:Nc \exp_args:Noooo
+          { \c_@@_text_prefix_tl #1 / #2 }
+          { \tl_to_str:n {#3} }
+          { \tl_to_str:n {#4} }
+          { \tl_to_str:n {#5} }
+          { \tl_to_str:n {#6} }
+      }
+      {#1}
+  }
+\cs_new:Npn \msg_expandable_error:nnnnn #1#2#3#4#5
+  { \msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} {#5} { } }
+\cs_new:Npn \msg_expandable_error:nnnn #1#2#3#4
+  { \msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} { } { } }
+\cs_new:Npn \msg_expandable_error:nnn #1#2#3
+  { \msg_expandable_error:nnnnnn {#1} {#2} {#3} { } { } { } }
+\cs_new:Npn \msg_expandable_error:nn #1#2
+  { \msg_expandable_error:nnnnnn {#1} {#2} { } { } { } { } }
+\cs_generate_variant:Nn \msg_expandable_error:nnnnnn { nnffff }
+\cs_generate_variant:Nn \msg_expandable_error:nnnnn  { nnfff }
+\cs_generate_variant:Nn \msg_expandable_error:nnnn   { nnff }
+\cs_generate_variant:Nn \msg_expandable_error:nnn    { nnf }
+\cs_new:Npn \@@_expandable_error_module:nn #1#2
+  {
+    \exp_after:wN \exp_after:wN
+    \exp_after:wN \@@_use_none_delimit_by_s_stop:w
+    \use:n { \::error ! ~ #2 : ~ #1 } \s_@@_stop
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</initex|package>
 %    \end{macrocode}





More information about the latex3-commits mailing list.