[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Generic hooks don't take arguments (a528c27c)

PhelypeOleinik phelype.oleinik at latex-project.org
Sun Mar 19 02:47:00 CET 2023


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

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

commit a528c27c8a41a8b538f72a9edc2f39e2224fa4f6
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sat Mar 18 22:47:00 2023 -0300

    Generic hooks don't take arguments


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

a528c27c8a41a8b538f72a9edc2f39e2224fa4f6
 base/lthooks.dtx | 27 ++++++++-------------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index fc67d8d7..ec8ab9de 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -173,9 +173,9 @@
 %   \begin{syntax}
 %     \cs{DisableGenericHook} \Arg{hook}
 %   \end{syntax}
-%    After this declaration\footnotemark{} the \meta{hook} is no longer usable: Any
-%    attempt to add further code to it will result in an error and any
-%    use, e.g., via \cs{UseHook}, will simply do nothing.
+%    After this declaration\footnotemark{} the \meta{hook} is no longer
+%    usable: Any further attempt to add code to it will result in an
+%    error and any use, e.g., via \cs{UseHook}, will simply do nothing.
 %
 %    This is intended to be used with generic command hooks (see
 %    \texttt{ltcmdhooks-doc}) as depending on the definition of the
@@ -2962,13 +2962,11 @@
 %
 %    \begin{macrocode}
 \cs_new_protected:Npn \hook_activate_generic:n #1
-  { \@@_normalize_hook_args:Nn \@@_activate_generic:nnn {#1} { } { 0 } }
-\cs_new_protected:Npn \hook_activate_generic_with_args:nn #1 #2
-  { \@@_normalize_hook_args:Nn \@@_activate_generic:nnn {#1} { } {#2} }
+  { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} {   } }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_activate_generic:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_activate_generic:nn #1 #2
   {
 %    \end{macrocode}
 %    If the hook to be activated was disabled we warn (for now --- this
@@ -2984,7 +2982,7 @@
         \@@_if_declared:nF {#1}
           {
             \tl_new:c { g_@@_#1_declared_tl }
-            \@@_make_usable:nn {#1} {#3}
+            \@@_make_usable:nn {#1} { 0 }
             \tl_gset:cx { g_@@_#1_reversed_tl }
               { \@@_if_generic_reversed:nT {#1} { - } }
 %    \end{macrocode}
@@ -3006,8 +3004,6 @@
 %    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2021/06/01}
 %<latexrelease>                 {\hook_activate_generic:n}{Providing~hooks}
-%<latexrelease>\cs_gset_protected:Npn \hook_activate_generic:n #1
-%<latexrelease>  { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} {   } }
 %<latexrelease>\cs_gset_protected:Npn \@@_activate_generic:nn #1 #2
 %<latexrelease>  {
 %<latexrelease>    \@@_if_disabled:nTF {#1}
@@ -6357,15 +6353,13 @@
 %<latexrelease>                 {\ActivateGenericHook}{Hooks~with~args}
 %    \end{macrocode}
 %
-%  \begin{macro}{\ActivateGenericHook,\ActivateGenericHookWithArguments}
+%  \begin{macro}{\ActivateGenericHook}
 %    Providing new hooks \ldots
 % \changes{v1.0m}{2021/04/29}{Add \cs{ProvideHook} etc.}
 % \changes{v1.0o}{2021/08/02}{Change name}
 %    \begin{macrocode}
 \NewDocumentCommand \ActivateGenericHook { m }
   { \hook_activate_generic:n {#1} }
-\NewDocumentCommand \ActivateGenericHookWithArguments { mm }
-  { \hook_activate_generic_with_args:nn {#1} {#2} }
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -6389,7 +6383,6 @@
 %%<latexrelease>  { \hook_activate_generic:n {#1} }
 %<latexrelease>\NewDocumentCommand \DisableGenericHook { m }
 %%<latexrelease>  { \hook_disable_generic:n {#1} }
-%<latexrelease>\cs_gset_protected:Npn \ActivateGenericHookWithArguments #1 { }
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
 %
@@ -6398,7 +6391,6 @@
 %<latexrelease>                 {\ActivateGenericHook}{Providing~hooks}
 %<latexrelease>\def \ActivateGenericHook #1 { }
 %<latexrelease>\def \DisableGenericHook #1 { }
-%<latexrelease>\def \ActivateGenericHookWithArguments #1 { }
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
 %
@@ -6635,10 +6627,7 @@
     \@@_activate_generic_pair:nn
   }
 \cs_new_protected:Npn \@@_activate_generic_reversed:n #1
-  {
-    \@@_normalize_hook_args:Nn \@@_activate_generic:nnn
-      {#1} { - } { 0 }
-  }
+  { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} { - } }
 \cs_new_protected:Npn \@@_activate_generic_pair:nn #1#2
   { \hook_activate_generic:n {#1} \@@_activate_generic_reversed:n {#2} }
 %    \end{macrocode}





More information about the latex3-commits mailing list.