[latex3-commits] [latex3/latex2e] cmd-args: Small updates and fixes (3e901fa4)
github at latex-project.org
github at latex-project.org
Thu May 18 01:57:40 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : cmd-args
Link : https://github.com/latex3/latex2e/commit/3e901fa40a5023c5138d14a22baa751d5500932f
>---------------------------------------------------------------
commit 3e901fa40a5023c5138d14a22baa751d5500932f
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Wed May 17 20:57:40 2023 -0300
Small updates and fixes
>---------------------------------------------------------------
3e901fa40a5023c5138d14a22baa751d5500932f
base/ltcmdhooks.dtx | 2 +-
base/lthooks.dtx | 2 +-
base/testfiles-lthooks/github-0674.lvt | 4 ++--
base/testfiles-lthooks/ltcmdhooks-003.tlg | 4 ----
base/testfiles-lthooks/ltcmdhooks-008.lvt | 10 +++++-----
base/testfiles-lthooks/ltcmdhooks-008.tlg | 10 +++++-----
6 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/base/ltcmdhooks.dtx b/base/ltcmdhooks.dtx
index 681b93ad..c3cad838 100644
--- a/base/ltcmdhooks.dtx
+++ b/base/ltcmdhooks.dtx
@@ -1092,10 +1092,10 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_retokenize_patch:Nnn #1 #2 #3
{
- \@@_patch_debug:x { ..~command~can~only~be~patched~by~rescanning }
\str_if_eq:eeTF { \cs_argument_spec:N #1 } { }
{ \@@_patch_expand_redefine:NNnn \c_false_bool #1 {#2} {#3} }
{
+ \@@_patch_debug:x { ..~command~can~only~be~patched~by~rescanning }
% \end{macrocode}
%
% Otherwise, we start the actual patching by retokenization job. The
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 8306b1b0..955ff6c7 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2782,8 +2782,8 @@
% Here we'll define the \cs[no-index]{c_@@_\meta{hook}_parameter_tl}
% to hold a run of parameters up to the number of arguments of the
% hook (\verb|#2|).
- \__kernel_cs_parm_from_arg_count:nnF
% \begin{macrocode}
+ \__kernel_cs_parm_from_arg_count:nnF
{ \tl_const:cn { c_@@_#1_parameter_tl } } {#2}
{
\msg_error:nnnn { hooks } { too-many-args } {#1} {#2}
diff --git a/base/testfiles-lthooks/github-0674.lvt b/base/testfiles-lthooks/github-0674.lvt
index e5a703e0..aaaa6999 100644
--- a/base/testfiles-lthooks/github-0674.lvt
+++ b/base/testfiles-lthooks/github-0674.lvt
@@ -18,12 +18,12 @@
\begin{document}
\begingroup
-\AddToHook{cmd/textbf/after}{\YYY} % patch is undone at group end
+\AddToHook{cmd/textbf/after}{\YYY} % patch is (no longer) undone at group end
\AddToHook{cmd/foo/after}{\YYY}
\endgroup
\START
-\ShowCommand\textbf % after hook not patched in but "before" hook is
+\ShowCommand\textbf % after hook not patched in but "before" hook is -- no, now both are
\ShowCommand\foo
\END
diff --git a/base/testfiles-lthooks/ltcmdhooks-003.tlg b/base/testfiles-lthooks/ltcmdhooks-003.tlg
index 811e2729..bfbb7208 100644
--- a/base/testfiles-lthooks/ltcmdhooks-003.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-003.tlg
@@ -198,7 +198,6 @@ l. ......clareRobustCommand*\fooH[3][x]{(#1,#2,#3)}
[lthooks] ++ control sequence is defined
[lthooks] ++ control sequence is a macro
[lthooks] ++ macro is not private
-[lthooks] .. command can only be patched by rescanning
[lthooks] ++ command can be patched without rescanning
**** Add to hook cmd/fooI/before (lbl) on input line ... <- before
-> Adding cmd hook to 'fooI' (after):
@@ -207,7 +206,6 @@ l. ......clareRobustCommand*\fooH[3][x]{(#1,#2,#3)}
[lthooks] ++ control sequence is defined
[lthooks] ++ control sequence is a macro
[lthooks] ++ macro is not private
-[lthooks] .. command can only be patched by rescanning
[lthooks] ++ command can be patched without rescanning
**** Add to hook cmd/fooI/after (lbl) on input line ... <- after
> \fooI=macro:
@@ -220,7 +218,6 @@ l. ...\test\newcommand*\fooI{(1,2,3)}
[lthooks] ++ control sequence is defined
[lthooks] ++ control sequence is a macro
[lthooks] ++ macro is not private
-[lthooks] .. command can only be patched by rescanning
[lthooks] ++ command can be patched without rescanning
**** Add to hook cmd/fooJ/before (lbl) on input line ... <- before
-> Adding cmd hook to 'fooJ' (after):
@@ -229,7 +226,6 @@ l. ...\test\newcommand*\fooI{(1,2,3)}
[lthooks] ++ control sequence is defined
[lthooks] ++ control sequence is a macro
[lthooks] ++ macro is not private
-[lthooks] .. command can only be patched by rescanning
[lthooks] ++ command can be patched without rescanning
**** Add to hook cmd/fooJ/after (lbl) on input line ... <- after
> \fooJ=\long macro:
diff --git a/base/testfiles-lthooks/ltcmdhooks-008.lvt b/base/testfiles-lthooks/ltcmdhooks-008.lvt
index 467ff87d..3cb2270f 100644
--- a/base/testfiles-lthooks/ltcmdhooks-008.lvt
+++ b/base/testfiles-lthooks/ltcmdhooks-008.lvt
@@ -11,7 +11,7 @@
\def\foo{foo}
\AddToHook{\foo}{before} \ShowHook{\foo}
-\DisableGenericHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHook{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
@@ -19,24 +19,24 @@
\AddToHook{\foo}{before} \ShowHook{\foo}
\NewHook{\foo} \ShowHook{\foo}
-\DisableGenericHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\typeout{=================================}
\def\foo{baz}
-\DisableGenericHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHookNext{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
\def\foo{env/foo/before}
-\DisableGenericHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHookNext{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
\def\foo{cmd/test/before}
-\DisableGenericHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHook{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
diff --git a/base/testfiles-lthooks/ltcmdhooks-008.tlg b/base/testfiles-lthooks/ltcmdhooks-008.tlg
index 7dc519a5..c2ef8ee7 100644
--- a/base/testfiles-lthooks/ltcmdhooks-008.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-008.tlg
@@ -29,7 +29,7 @@ l. ...\AddToHook{\foo}{before} \ShowHook{\foo}
> Execution order:
> Not set because the hook is disabled.
<recently read> }
-l. ......GenericHook{\foo} \ShowHook{\foo}
+l. ...\DisableGenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'foo'.
For immediate help type H <return>.
...
@@ -95,14 +95,14 @@ l. ...\NewHook{\foo} \ShowHook{\foo}
> Execution order:
> Not set because the hook is disabled.
<recently read> }
-l. ......GenericHook{\foo} \ShowHook{\foo}
+l. ...\DisableGenericHook{\foo} \ShowHook{\foo}
=================================
-> The hook 'baz':
> The hook is not declared.
> The hook is disabled.
> The hook is empty.
<recently read> }
-l. ......GenericHook{\foo} \ShowHook{\foo}
+l. ...\DisableGenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'baz'.
For immediate help type H <return>.
...
@@ -123,7 +123,7 @@ l. ...\AddToHookNext{\foo}{after} \ShowHook{\foo}
> The hook is disabled.
> The hook is empty.
<recently read> }
-l. ......GenericHook{\foo} \ShowHook{\foo}
+l. ...\DisableGenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'env/foo/before'.
For immediate help type H <return>.
...
@@ -144,7 +144,7 @@ l. ...\AddToHookNext{\foo}{after} \ShowHook{\foo}
> The hook is disabled.
> The hook is empty.
<recently read> }
-l. ......GenericHook{\foo} \ShowHook{\foo}
+l. ...\DisableGenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'cmd/test/before'.
For immediate help type H <return>.
...
More information about the latex3-commits
mailing list.