[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use an expl3 message to avoid defining \@latex at error (also fixes #800) (89347cece)

PhelypeOleinik phelype.oleinik at latex-project.org
Sun Sep 6 13:34:29 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/89347cece68bf6d3de80823b7e7d8998d596415c

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

commit 89347cece68bf6d3de80823b7e7d8998d596415c
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sun Sep 6 08:34:29 2020 -0300

    Use an expl3 message to avoid defining \@latex at error (also fixes #800)


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

89347cece68bf6d3de80823b7e7d8998d596415c
 l3kernel/l3file.dtx | 85 ++++++++++++++++++++++++++---------------------------
 1 file changed, 41 insertions(+), 44 deletions(-)

diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 55121878d..54a243d0f 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -3606,31 +3606,34 @@
     \ior_map_inline:Nn \g_@@_internal_ior
       { \seq_put_right:Nn \l_@@_tmp_seq {##1} }
     \ior_close:N \g_@@_internal_ior
+    \__kernel_msg_error:nnnn { kernel } { mismatched-support-file }
+      {#1} {#2}
 %    \end{macrocode}
-%   Now define a some shorthands so that we can use \cs{@latex at error}
-%   (almost) easily:
+%   And finish by ending the current file.
 %    \begin{macrocode}
-    \group_begin:
-      \cs_set:Npn \\ { \MessageBreak }
-      \cs_set_eq:NN \  \c_space_tl
-      \@latex at error
-        {
-          Mismatched~LaTeX~support~files~detected. \\
-          Loading~'#2'~aborted!
+    \tex_endinput:D
+  }
+%    \begin{macrocode}
+%
+%   Now define the actual error message:
+%    \begin{macrocode}
+\__kernel_msg_new:nnnn { kernel } { mismatched-support-file }
+  {
+    Mismatched~LaTeX~support~files~detected. \\
+    Loading~'#2'~aborted!
 %    \end{macrocode}
 %   \cs{c__kernel_expl_date_tl} may not exist, due to an older format,
 %   so only print the dates when the sentinel token list exists:
 %    \begin{macrocode}
-          \tl_if_exist:NT \c__kernel_expl_date_tl
-            {
-              \\ \\
-              The~L3~programming~layer~in~the~LaTeX~format \\
-              is~dated~\c__kernel_expl_date_tl,~but~in~your~TeX~
-              tree~the~files~require \\ at~least~#1.
-            }
-          \use_none:n
-        }
-        {
+    \tl_if_exist:NT \c__kernel_expl_date_tl
+      {
+        \\ \\
+        The~L3~programming~layer~in~the~LaTeX~format \\
+        is~dated~\c__kernel_expl_date_tl,~but~in~your~TeX~
+        tree~the~files~require \\ at~least~#1.
+      }
+  }
+  {
 %    \end{macrocode}
 %   The sequence containing the format files should have exactly one
 %   item: the format file currently being run.  If that's the case, the
@@ -3639,31 +3642,25 @@
 %   the list to the user, with appropriate indications of what's in the
 %   system and what's in the user tree.
 %    \begin{macrocode}
-          \int_compare:nNnTF { \seq_count:N \l_@@_tmp_seq } > 1
-            {
-              The~cause~seems~to~be~an~old~format~file~in~the~user~tree. \\
-              LaTeX~found~these~files:
-              \seq_map_tokens:Nn \l_@@_tmp_seq { \\~-~\use:n } \\
-              Try~deleting~the~file~in~the~user~tree~then~run~LaTeX~again.
-            }
-            {
-              The~most~likely~causes~are:
-              \\~-~A~recent~format~generation~failed;
-              \\~-~A~stray~format~file~in~the~user~tree~which~needs~
-                   to~be~removed~or~rebuilt;
-              \\~-~You~are~running~a~manually~installed~version~of~#2 \\
-              \ \ \ which~is~incompatible~with~the~version~in~LaTeX. \\
-            }
-          \\
-          LaTeX~will~abort~loading~the~incompatible~support~files~
-          but~this~may~lead~to \\ later~errors.~Please~ensure~that~
-          your~LaTeX~format~is~correctly~regenerated.
-        }
-    \group_end:
-%    \end{macrocode}
-%   And finish by ending the current file.
-%    \begin{macrocode}
-    \tex_endinput:D
+    \int_compare:nNnTF { \seq_count:N \l_@@_tmp_seq } > 1
+      {
+        The~cause~seems~to~be~an~old~format~file~in~the~user~tree. \\
+        LaTeX~found~these~files:
+        \seq_map_tokens:Nn \l_@@_tmp_seq { \\~-~\use:n } \\
+        Try~deleting~the~file~in~the~user~tree~then~run~LaTeX~again.
+      }
+      {
+        The~most~likely~causes~are:
+        \\~-~A~recent~format~generation~failed;
+        \\~-~A~stray~format~file~in~the~user~tree~which~needs~
+             to~be~removed~or~rebuilt;
+        \\~-~You~are~running~a~manually~installed~version~of~#2 \\
+        \ \ \ which~is~incompatible~with~the~version~in~LaTeX. \\
+      }
+    \\
+    LaTeX~will~abort~loading~the~incompatible~support~files~
+    but~this~may~lead~to \\ later~errors.~Please~ensure~that~
+    your~LaTeX~format~is~correctly~regenerated.
   }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list.