[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Correct logging next code (bf7bfe04)
PhelypeOleinik
phelype.oleinik at latex-project.org
Thu Mar 30 02:58:01 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : hook-args
Link : https://github.com/latex3/latex2e/commit/bf7bfe04f6d7d90304587303cf146d41d434315b
>---------------------------------------------------------------
commit bf7bfe04f6d7d90304587303cf146d41d434315b
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Wed Mar 29 21:58:01 2023 -0300
Correct logging next code
>---------------------------------------------------------------
bf7bfe04f6d7d90304587303cf146d41d434315b
base/lthooks.dtx | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index d6cdc1d9..b3dc9e5d 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -5667,7 +5667,10 @@
% the first tokens (the code to clear itself) so we call a helper
% command to get rid of them.
% \begin{macrocode}
- { ->~ \exp_args:Nv \@@_log_next_code:n { @@_next~#1 } }
+ {
+ -> ~ \exp_last_unbraced:Nf \@@_log_next_code:w
+ { \cs_replacement_spec:c { @@_next~#1 } }
+ }
}
% \end{macrocode}
%
@@ -5827,11 +5830,20 @@
%
% \begin{macro}{\@@_log_next_code:n}
% To display the code for next invocation only (i.e., from
-% \cs{AddToHookNext} we have to remove the first two tokens at the
-% front which are \cs{tl_gclear:N} and the token list to clear.
+% \cs{AddToHookNext} we have to remove the string
+% \cs{@@_clear_next:n}\Arg{hook}, so the simplest is to use a macro
+% delimited by a \verb|}|$_12$.
% \begin{macrocode}
-\cs_new:Npn \@@_log_next_code:n #1
- { \exp_args:No \tl_to_str:n { \use_none:nn #1 } }
+%<latexrelease>\IncludeInRelease{2023/06/01}{\@@_log:nN}
+%<latexrelease> {Hooks~with~args}
+\exp_last_unbraced:NNNNo
+\cs_new:Npn \@@_log_next_code:w #1 \c_right_brace_str { }
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_log:nN}
+%<latexrelease> {Hooks~with~args}
+%<latexrelease>\cs_gset:Npn \@@_log_next_code:n #1
+%<latexrelease> { \exp_args:No \tl_to_str:n { \use_none:nn #1 } }
+%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
% \end{macro}
%
More information about the latex3-commits
mailing list.