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

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Mar 9 01:49:41 CET 2023


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

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

commit a24d1ef39c3a00ba78d9af02ffb319fc0fa7dacd
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.


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

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

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 76012c3b..de57ce92 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.