[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Hard-code top-level as the initial default label (6b2e81fc)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Dec 14 17:07:48 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh441
Link       : https://github.com/latex3/latex2e/commit/6b2e81fc0afc4588c1860e098746b2136d7924d4

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

commit 6b2e81fc0afc4588c1860e098746b2136d7924d4
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon Dec 14 13:07:48 2020 -0300

    Hard-code top-level as the initial default label


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

6b2e81fc0afc4588c1860e098746b2136d7924d4
 base/lthooks.dtx                       | 12 +++++++-----
 base/testfiles-lthooks/lthooks-008.lvt |  5 ++---
 base/testfiles-lthooks/lthooks-024.lvt |  6 ++----
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index a2276447..833235e9 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -3997,6 +3997,8 @@
 %  \end{macro}
 %
 % \begin{macro}{\SetDefaultHookLabel}
+% \begin{macro}{\PushDefaultHookLabel}
+% \begin{macro}{\PopDefaultHookLabel}
 % \begin{macro}{\DeclareDefaultHookLabel}
 % \begin{macro}{\@@_curr_name_push:n,\@@_curr_name_pop:}
 %   The token list \cs{g_@@_hook_curr_name_tl} stores the name of the
@@ -4031,12 +4033,10 @@
 %<latexrelease>  \q_recursion_tail \q_recursion_stop
 %    \end{macrocode}
 %
-%   Finally, an empty entry is added to the
-%   stack to account for the \verb|top-level|.  The item is empty so
-%   that the hard-coded default is used, but a call to
-%   \cs{SetDefaultHookLabel} will change it if needed.
+%   Finally, \verb|top-level| is added to the stack for the document
+%   body.
 %    \begin{macrocode}
-\seq_gpush:Nn \g_@@_name_stack_seq { }
+\seq_gpush:Nn \g_@@_name_stack_seq { top-level }
 %    \end{macrocode}
 %
 %   Two commands keep track of the stack: when a file is input,
@@ -4086,6 +4086,8 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 %
 %
diff --git a/base/testfiles-lthooks/lthooks-008.lvt b/base/testfiles-lthooks/lthooks-008.lvt
index 612ebf2c..343cfefb 100644
--- a/base/testfiles-lthooks/lthooks-008.lvt
+++ b/base/testfiles-lthooks/lthooks-008.lvt
@@ -30,10 +30,9 @@
 
 \AtEndDocument{\typeout{on top-level}}
 
-\makeatletter
-\def\@currname{mypackage}
+\SetDefaultHookLabel{mypackage}
 \AtEndDocument{\typeout{from my package}}
-\makeatother
+\SetDefaultHookLabel{top-level}
 
 \ExplSyntaxOn
 \prop_log:N \g__hook_enddocument_code_prop
diff --git a/base/testfiles-lthooks/lthooks-024.lvt b/base/testfiles-lthooks/lthooks-024.lvt
index 8e15d86a..ad0a85cd 100644
--- a/base/testfiles-lthooks/lthooks-024.lvt
+++ b/base/testfiles-lthooks/lthooks-024.lvt
@@ -40,11 +40,9 @@
 % No \@currname
 \testme{top-level}
 
-% With \@currname
-\begingroup
-  \def\@currname{pkg}
+\SetDefaultHookLabel{pkg}
   \testme{pkg}
-\endgroup
+\SetDefaultHookLabel{top-level}
 
 \OMIT
 





More information about the latex3-commits mailing list.