[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Generic hooks can't have arguments (c10c562b)

PhelypeOleinik phelype.oleinik at latex-project.org
Sat Mar 11 03:06:36 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : hook-args
Link       : https://github.com/latex3/latex2e/commit/c10c562b3f725810990a131a66fbd5e04a0e94b8

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

commit c10c562b3f725810990a131a66fbd5e04a0e94b8
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Wed Mar 8 21:49:41 2023 -0300

    Generic hooks can't have arguments
    
    They could, eventually, but the number of arguments would have to be
    predefined for each type of generic hook.


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

c10c562b3f725810990a131a66fbd5e04a0e94b8
 base/lthooks.dtx | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 2dfe30ac..04ee670f 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2096,11 +2096,14 @@
 % \end{macro}
 %
 % \begin{macro}{\c_@@_nine_parameters_tl}
+% \begin{macro}{\c_@@_empty_tl}
 %   A token list that contains nine parameters.
 %    \begin{macrocode}
 \tl_const:Nn \c_@@_nine_parameters_tl { #1#2#3#4#5#6#7#8#9 }
+\tl_const:Nn \c_@@_empty_tl { }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}[int]{\tl_gremove_once:Nx,\tl_show:x,\tl_log:x}
 %   Some variants of \pkg{expl3} functions.
@@ -2574,7 +2577,15 @@
         c_@@_
         \tl_if_exist:cTF { c_@@_#2_parameter_tl }
             { \use_i:nn }
-            { \@@_if_declared:nTF {#2} { \use_i:nn } { \use_ii:nn } }
+            {
+              \@@_if_declared:nTF {#2}
+                { \use_i:nn }
+                {
+                  \@@_if_generic:nTF {#2}
+                    { empty \use_none:nn }
+                    { \use_ii:nn }
+                }
+            }
           { #2_parameter }
           { nine_parameters }
         _tl





More information about the latex3-commits mailing list.