[latex3-commits] [git/LaTeX3-latex3-latex3] main: Make error message look nicer (b5e7a2026)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Feb 10 22:14:32 CET 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/b5e7a2026f2c81d8055004336030bdc82ce6b91d

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

commit b5e7a2026f2c81d8055004336030bdc82ce6b91d
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Feb 10 18:14:32 2022 -0300

    Make error message look nicer
    
    to the expense of the code looking awful


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

b5e7a2026f2c81d8055004336030bdc82ce6b91d
 l3kernel/l3bootstrap.dtx | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/l3kernel/l3bootstrap.dtx b/l3kernel/l3bootstrap.dtx
index aca61b430..226ec5f0c 100644
--- a/l3kernel/l3bootstrap.dtx
+++ b/l3kernel/l3bootstrap.dtx
@@ -235,7 +235,7 @@
   \def\LongText%
     {%
       The L3 programming layer requires the e-TeX primitives and additional
-      functionality as described in the README file.
+      \LineBreak functionality as described in the README file.
       \LineBreak
       These are available in the engines\LineBreak
       - pdfTeX v1.40.0\LineBreak
@@ -260,11 +260,15 @@
       \def\LineBreak{\noexpand\MessageBreak}%
       \expandafter\ifx\csname PackageError\endcsname\relax
         \def\LineBreak{^^J}%
-        \def\PackageError#1#2#3%
-          {%
-            \errhelp{#3}%
-            \errmessage{#1 Error: #2}%
-          }%
+        \begingroup
+          \lccode`\~=`\ \lccode`\}=`\ %
+          \lccode`\T=`\T\lccode`\H=`\H%
+          \catcode`\ =11 %
+\lowercase{\endgroup\def\PackageError#1#2#3{%
+\begingroup\errorcontextlines-1\immediate\write0{}\errhelp{#3}\def%
+\                                                   {#1 Error: #2.^^J^^J
+Type  H <return>  for immediate help}\def~{\errmessage{%
+\                                                   }}~\endgroup}}%
       \fi
       \edef\next
         {%





More information about the latex3-commits mailing list.