[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Missing argument to error message (219baa69)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Dec 17 23:06:07 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh441
Link       : https://github.com/latex3/latex2e/commit/219baa690de42fead079dfca68e78958cac44c96

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

commit 219baa690de42fead079dfca68e78958cac44c96
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Dec 17 19:06:07 2020 -0300

    Missing argument to error message


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

219baa690de42fead079dfca68e78958cac44c96
 base/lthooks.dtx                          |  7 +++++--
 base/testfiles-lthooks/lthooks-errors.lvt |  1 +
 base/testfiles-lthooks/lthooks-errors.tlg | 10 ++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 9af00aac..00311ce5 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -4248,8 +4248,11 @@
 \cs_new_protected:Npn \@@_set_default_label:n #1
   {
     \str_if_eq:nnTF {#1} { top-level }
-      { \msg_error:nnnn { hooks } { set-top-level } { to } {#1} }
-      { \tl_gset:Nx \g_@@_hook_curr_name_tl {#1} }
+      {
+        \msg_error:nnnnn { hooks } { set-top-level }
+          { to } { SetDefaultHookLabel } {#1}
+      }
+      { \tl_gset:Nn \g_@@_hook_curr_name_tl {#1} }
   }
 \NewDocumentCommand \DeclareDefaultHookLabel { m }
   {
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors.lvt
index 40fbc1c4..d8ee750e 100644
--- a/base/testfiles-lthooks/lthooks-errors.lvt
+++ b/base/testfiles-lthooks/lthooks-errors.lvt
@@ -38,6 +38,7 @@
 \PushDefaultHookLabel{my-document}
   % top-level not allowed with other labels
   \AddToHook{begindocument}[top-level]{not allowed}
+  \SetDefaultHookLabel{top-level}
 \PopDefaultHookLabel
 
 % extra \PopDefaultHookLabel error
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
index 7275b9e1..40d85ea5 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -60,6 +60,16 @@ l. ......ook{begindocument}[top-level]{not allowed}
 The 'top-level' label is meant for user code only, and should only be used
 (sparingly) in the main document. Use the default label 'my-document' for this
 package, or another suitable label.
+! Package hooks Error: You cannot change the default label to `top-level'.
+(hooks)                Illegal
+(hooks)                  \SetDefaultHookLabel{top-level}
+(hooks)                on line ....
+Type <return> to continue.
+ ...                                              
+l. ...  \SetDefaultHookLabel{top-level}
+LaTeX does not know anything more about this error, sorry.
+Try typing <return> to proceed.
+If that doesn't work, type X <return> to quit.
 ! Package hooks Error: Extra \PopDefaultHookLabel.
 (hooks)                This command will be ignored.
 Type <return> to continue.





More information about the latex3-commits mailing list.