[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks-doc-updates: \ProvideHook -> \ActivateGenericHook \hook_provide:n -> \hook_activate_generic:n (3d5ef028)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Aug 2 17:06:38 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : lthooks-doc-updates
Link       : https://github.com/latex3/latex2e/commit/3d5ef028589b641a353b5840b252f33c48199846

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

commit 3d5ef028589b641a353b5840b252f33c48199846
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Aug 2 17:06:38 2021 +0200

    \ProvideHook -> \ActivateGenericHook
    \hook_provide:n -> \hook_activate_generic:n


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

3d5ef028589b641a353b5840b252f33c48199846
 base/lthooks.dtx                          | 44 +++++++++++++++----------------
 base/testfiles-lthooks/lthooks-029.lvt    | 12 ++++-----
 base/testfiles-lthooks/lthooks-029.tlg    |  2 +-
 base/testfiles-lthooks/lthooks-errors.lvt |  4 +--
 base/testfiles-lthooks/lthooks-errors.tlg |  2 +-
 5 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index a9c23a34..d9337e6f 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -204,9 +204,9 @@
 % \end{function}
 %
 %
-% \begin{function}{\ProvideHook}
+% \begin{function}{\ActivateGenericHook}
 %   \begin{syntax}
-%     \cs{ProvideHook} \Arg{hook}
+%     \cs{ActivateGenericHook} \Arg{hook}
 %   \end{syntax}
 %   Like \cs{NewHook} but does nothing if the hook was previously
 %    declared with \cs{NewHook}.  This declaration should only be used
@@ -230,7 +230,7 @@
 %     \cs{ProvideMirroredHookPair} \Arg{hook-1} \Arg{hook-2}
 %   \end{syntax}
 %     A shorthand for
-%    \cs{ProvideHook}\Arg{hook-1}\cs{ProvideReversedHook}\Arg{hook-2}.
+%    \cs{ActivateGenericHook}\Arg{hook-1}\cs{ProvideReversedHook}\Arg{hook-2}.
 % \end{function}
 %
 %
@@ -960,9 +960,9 @@
 %    the current package name. See section~\ref{sec:default-label}.
 % \end{function}
 %
-% \begin{function}{\hook_provide:n}
+% \begin{function}{\hook_activate_generic:n}
 %   \begin{syntax}
-%     \cs{hook_provide:n} \Arg{hook}
+%     \cs{hook_activate_generic:n} \Arg{hook}
 %   \end{syntax}
 %    Like \cs{hook_new:n} but does nothing if the hook was previously
 %    declared with \cs{hook_new:n}.  This declaration should only be used
@@ -986,7 +986,7 @@
 %     \cs{hook_provide_pair:nn} \Arg{hook-1} \Arg{hook-2}
 %   \end{syntax}
 %     A shorthand for
-%    \cs{hook_provide:n}\Arg{hook-1}\cs{hook_provide_reversed:n}\Arg{hook-2}.
+%    \cs{hook_activate_generic:n}\Arg{hook-1}\cs{hook_provide_reversed:n}\Arg{hook-2}.
 % \end{function}
 %
 %
@@ -2529,28 +2529,28 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\hook_provide:n}
+% \begin{macro}{\hook_activate_generic:n}
 % \begin{macro}{\hook_provide_reversed:n}
-% \begin{macro}{\@@_provide:n}
-%    The \cs{hook_provide:n} declaration declares a new hook if it
+% \begin{macro}{\@@_activate_generic:n}
+%    The \cs{hook_activate_generic:n} declaration declares a new hook if it
 %    wasn't declared already, in which case it only checks that the
 %    already existing hook is not a reversed hook.
 %    The \cs{hook_provide_reversed:n} does the same for reversed hooks.
 %    \hook{begindocument}.
 %    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2021/06/01}%
-%<latexrelease>         {\hook_provide:n}{Providing~hooks}
+%<latexrelease>         {\hook_activate_generic:n}{Providing~hooks}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \hook_provide:n #1
-  { \@@_normalize_hook_args:Nn \@@_provide:nn {#1} {   } }
+\cs_new_protected:Npn \hook_activate_generic:n #1
+  { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} {   } }
 \cs_new_protected:Npn \hook_provide_reversed:n #1
-  { \@@_normalize_hook_args:Nn \@@_provide:nn {#1} { - } }
+  { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} { - } }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_provide:nn #1 #2
+\cs_new_protected:Npn \@@_activate_generic:nn #1 #2
   {
 %    \end{macrocode}
 %    If the hook to be provided was disabled we warn (for now --- this
@@ -2591,7 +2591,7 @@
 %    A shorthand for providing a normal and a (matching) reversed hook in one go.
 %    \begin{macrocode}
 \cs_new_protected:Npn \hook_provide_pair:nn #1#2
-  { \hook_provide:n {#1} \hook_provide_reversed:n {#2} }
+  { \hook_activate_generic:n {#1} \hook_provide_reversed:n {#2} }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2601,10 +2601,10 @@
 %
 %    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2020/10/01}
-%<latexrelease>                 {\hook_provide:n}{Providing~hooks}
+%<latexrelease>                 {\hook_activate_generic:n}{Providing~hooks}
 %<latexrelease>
 %<latexrelease>\cs_new_protected:Npn \hook_provide_reversed:n #1 {}
-%<latexrelease>\cs_new_protected:Npn \hook_provide:n #1 {}
+%<latexrelease>\cs_new_protected:Npn \hook_activate_generic:n #1 {}
 %<latexrelease>\cs_new_protected:Npn \hook_provide_pair:nn #1#2 {}
 %<latexrelease>
 %<latexrelease>\EndIncludeInRelease
@@ -4783,14 +4783,14 @@
 %
 %    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2021/06/01}%
-%<latexrelease>         {\hook_provide:n}{Providing~hooks}
+%<latexrelease>         {\hook_activate_generic:n}{Providing~hooks}
 %    \end{macrocode}
 %
-%  \begin{macro}{\ProvideHook,\ProvideReversedHook,\ProvideMirroredHookPair}
+%  \begin{macro}{\ActivateGenericHook,\ProvideReversedHook,\ProvideMirroredHookPair}
 %    Providing new hooks \ldots
 % \changes{v1.0m}{2021/04/29}{Add \cs{ProvideHook} etc.}
 %    \begin{macrocode}
-\NewDocumentCommand \ProvideHook         { m }{ \hook_provide:n {#1} }
+\NewDocumentCommand \ActivateGenericHook         { m }{ \hook_activate_generic:n {#1} }
 \NewDocumentCommand \ProvideReversedHook { m }{ \hook_provide_reversed:n {#1} }
 \NewDocumentCommand \ProvideMirroredHookPair { mm }{ \hook_provide_pair:nn {#1}{#2} }
 %    \end{macrocode}
@@ -4807,9 +4807,9 @@
 %    \begin{macrocode}
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{2020/10/01}
-%<latexrelease>                 {\hook_provide:n}{Providing~hooks}
+%<latexrelease>                 {\hook_activate_generic:n}{Providing~hooks}
 %<latexrelease>
-%<latexrelease>\def \ProvideHook#1{}
+%<latexrelease>\def \ActivateGenericHook#1{}
 %<latexrelease>\def \ProvideReversedHook#1{}
 %<latexrelease>\def \ProvideMirroredHookPair#1#2{}
 %<latexrelease>
diff --git a/base/testfiles-lthooks/lthooks-029.lvt b/base/testfiles-lthooks/lthooks-029.lvt
index 8be5ffbb..371a77c2 100644
--- a/base/testfiles-lthooks/lthooks-029.lvt
+++ b/base/testfiles-lthooks/lthooks-029.lvt
@@ -20,23 +20,23 @@
 
 \typeout{------------ provide a known hook --------------}
 
-\ProvideHook{aaa}
+\ActivateGenericHook{aaa}
 \ShowHook{aaa}
 
 \typeout{------------ provide a known hook with data --------------}
 
 \AddToHook{aaa}[X]{X1}
 
-\ProvideHook{aaa}
+\ActivateGenericHook{aaa}
 \ShowHook{aaa}
 
 \AddToHook{bbb}[Y]{Y1}
 
 \typeout{------------ provide an unknown hook with data --------------}
 
-\ProvideHook{bbb}
+\ActivateGenericHook{bbb}
 \ShowHook{bbb}
-\ProvideHook{bbb}
+\ActivateGenericHook{bbb}
 \ShowHook{bbb}
 
 \typeout{------------ provide an unknown reversed hook --------------}
@@ -63,13 +63,13 @@
 
 \typeout{------------ provide an normal hook on an existing reversed hook --------------}
 
-\ProvideHook{ccc}
+\ActivateGenericHook{ccc}
 \ShowHook{ccc}
 
 \typeout{------------ provide hook that was disabled --------------}
 
 \DisableGenericHook{ddd}
-\ProvideHook{ddd}
+\ActivateGenericHook{ddd}
 \ShowHook{ddd}
 
 
diff --git a/base/testfiles-lthooks/lthooks-029.tlg b/base/testfiles-lthooks/lthooks-029.tlg
index cd2f5e9d..37a262b3 100644
--- a/base/testfiles-lthooks/lthooks-029.tlg
+++ b/base/testfiles-lthooks/lthooks-029.tlg
@@ -114,7 +114,7 @@ l. ...\ShowHook{aaa}
 ! LaTeX hooks Error: Hook 'ccc' already declared as a reversed hook!
 For immediate help type H <return>.
  ...                                              
-l. ...\ProvideHook{ccc}
+l. ...\ActivateGenericHook{ccc}
 You attempted to provide the hook 'ccc' as a normal hook, but it was already
 previously declared as a reversed hook. A redeclaration is not possible.
 -> The hook 'ccc':
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors.lvt
index 34ae8f9a..dc5d1ce6 100644
--- a/base/testfiles-lthooks/lthooks-errors.lvt
+++ b/base/testfiles-lthooks/lthooks-errors.lvt
@@ -21,11 +21,11 @@
 \NewReversedHook{yyy}
 
 % provide-error
-\ProvideHook{yyy}
+\ActivateGenericHook{yyy}
 \DisableGenericHook{yyy}
 
 % provide-disabled
-\ProvideHook{yyy}
+\ActivateGenericHook{yyy}
 
 % hook-disabled
 \AddToHook{yyy}{error}
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
index 98dbf3ca..ff13e831 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -15,7 +15,7 @@ previously declared as a normal hook. A redeclaration is not possible.
 ! LaTeX hooks Error: Hook 'yyy' already declared as a reversed hook!
 For immediate help type H <return>.
  ...                                              
-l. ...\ProvideHook{yyy}
+l. ...\ActivateGenericHook{yyy}
 You attempted to provide the hook 'yyy' as a normal hook, but it was already
 previously declared as a reversed hook. A redeclaration is not possible.
 LaTeX hooks Warning: Cannot provide hook 'yyy' because it is disabled!





More information about the latex3-commits mailing list.