[latex3-commits] [git/LaTeX3-latex3-latex3] master: More work on fatal error 'escape' (see #587) (b83302b)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jun 3 20:46:50 CEST 2019


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

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

commit b83302b0d35456a7f1a54a79b3e440b3b5786cca
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jun 3 18:41:14 2019 +0100

    More work on fatal error 'escape' (see #587)


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

b83302b0d35456a7f1a54a79b3e440b3b5786cca
 l3kernel/l3msg.dtx                      |   25 +++++++++++++++++++++++--
 l3kernel/testfiles/m3expl001.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    1 +
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    1 +
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 l3kernel/testfiles/m3msg001.lvt         |    4 ++--
 l3kernel/testfiles/m3msg004.lvt         |    8 ++++----
 13 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index 05ca51d..c07bb4a 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -967,7 +967,10 @@
 %     \msg_fatal:nnxx   ,
 %     \msg_fatal:nnx
 %   }
-%   For fatal errors, after the error message \TeX{} bails out.
+%  \begin{macro}{\@@_fatal_exit:}
+%   For fatal errors, after the error message \TeX{} bails out. We force
+%   a bail out rather than using \tn{end} as this means it does not
+%   matter if we are in a context where normally the run cannot end.
 %    \begin{macrocode}
   \@@_class_new:nn { fatal }
     {
@@ -976,11 +979,29 @@
         {#1}
         { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
         { \c_@@_fatal_text_tl }
+      \@@_fatal_exit:
+    }
+  \cs_new_protected:Npn \@@_fatal_exit:
+    {
       \tex_batchmode:D
-      \tex_end:D
+      \tex_everycr:D   { }
+      \tex_everyhbox:D { }
+      \tex_everypar:D  { }
+      \tex_everyvbox:D { }
+      \tex_vbox:D 
+        {
+          \tex_halign:D
+            {
+              ## && ##
+              \tex_cr:D
+              \int_step_inline:nn { 300 } { \tex_span:D \tex_omit:D }
+              \tex_cr:D
+            }
+        }
     }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}
 %   {
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 021feb4..63e56a1 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2514,6 +2514,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index cfd4df8..920fbc4 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -2768,6 +2768,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index d51e64d..b65666d 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -2768,6 +2768,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index e2bbee4..26d2fba 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -2768,6 +2768,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 20c9f15..7e31386 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2512,6 +2512,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 021feb4..63e56a1 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2514,6 +2514,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index cfd4df8..920fbc4 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -2768,6 +2768,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index d51e64d..b65666d 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -2768,6 +2768,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index e2bbee4..26d2fba 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -2768,6 +2768,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 20c9f15..7e31386 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2512,6 +2512,7 @@ Defining \msg_fatal:nnxxxx on line ...
 Defining \msg_fatal:nnxxx on line ...
 Defining \msg_fatal:nnxx on line ...
 Defining \msg_fatal:nnx on line ...
+Defining \__msg_fatal_exit: on line ...
 Defining \l__msg_redirect_critical_prop on line ...
 Defining \__msg_critical_code:nnnnnn on line ...
 Defining \msg_critical:nnnnnn on line ...
diff --git a/l3kernel/testfiles/m3msg001.lvt b/l3kernel/testfiles/m3msg001.lvt
index 4a4e2d0..eb1404d 100644
--- a/l3kernel/testfiles/m3msg001.lvt
+++ b/l3kernel/testfiles/m3msg001.lvt
@@ -42,7 +42,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \TEST{Issuing~fatal~messages~(without~stopping!)}{
   \OMIT
-  \cs_set_eq:NN \tex_end:D \scan_stop:
+  \cs_set_eq:NN \__msg_fatal_exit: \scan_stop:
   \TIMO
   \msg_fatal:nnxxxx {module} {name} {\l_test_tl} {\l_test_tl}
     {\l_test_tl} {\l_test_tl}
@@ -173,7 +173,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \TEST{Issuing~kernel~fatal~messages~(without~stopping!)}{
   \OMIT
-  \cs_set_eq:NN \tex_end:D \scan_stop:
+  \cs_set_eq:NN \__msg_fatal_exit: \scan_stop:
   \TIMO
   \__kernel_msg_fatal:nnxxxx {division} {name} {\l_test_tl} {\l_test_tl}
     {\l_test_tl} {\l_test_tl}
diff --git a/l3kernel/testfiles/m3msg004.lvt b/l3kernel/testfiles/m3msg004.lvt
index 786a96a..c9639f9 100644
--- a/l3kernel/testfiles/m3msg004.lvt
+++ b/l3kernel/testfiles/m3msg004.lvt
@@ -27,8 +27,8 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \TEST { Kernel~fatal~all~arg~types }
   {
-    % Redefine \tex_end:D to avoid ending the run.
-    \cs_set_protected:Npn \tex_end:D { \TYPE { tex_end:D } }
+    % Redefine \@@_fatal_exit: to avoid ending the run.
+    \cs_set_protected:Npn \__msg_fatal_exit: { \TYPE { tex_end:D } }
     \tl_map_inline:nn
       { {nnnnnn} {nnnnn} {nnnn} {nnn} {nn} {nnx} {nnxx} {nnxxx} {nnxxxx} }
       {
@@ -70,9 +70,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \TEST { Various~non-kernel~classes }
   {
-    % Redefine \tex_end:D and \tex_endinput:D to prevent
+    % Redefine \__msg_fatal_exit: and \tex_endinput:D to prevent
     % 'fatal' and 'critical' errors from doing their thing.
-    \cs_set_protected:Npn \tex_end:D { \TYPE { tex_end:D } }
+    \cs_set_protected:Npn \__msg_fatal_exit: { \TYPE { tex_end:D } }
     \cs_set_protected:Npn \tex_endinput:D { \TYPE { tex_endinput:D } }
     \tl_map_inline:nn
       { {fatal} {critical} {error} {warning} {info} {log} {none} }





More information about the latex3-commits mailing list