[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks-doc-updates: \hook_disable:n -> \hook_disable_generic:n (531c8a18)
Frank Mittelbach
frank.mittelbach at latex-project.org
Sun Aug 1 19:13:54 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : lthooks-doc-updates
Link : https://github.com/latex3/latex2e/commit/531c8a18ebbdc8cb152db64d441e685ca47ae473
>---------------------------------------------------------------
commit 531c8a18ebbdc8cb152db64d441e685ca47ae473
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Sun Aug 1 19:13:54 2021 +0200
\hook_disable:n -> \hook_disable_generic:n
>---------------------------------------------------------------
531c8a18ebbdc8cb152db64d441e685ca47ae473
base/lthooks.dtx | 18 +++++++++---------
base/testfiles-lthooks/ltcmdhooks-008.tlg | 18 ++++++++++--------
base/testfiles-lthooks/lthooks-errors.tlg | 6 ++++--
3 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 93ed9207..a9c23a34 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -944,9 +944,9 @@
%
%
%
-% \begin{function}{\hook_disable:n}
+% \begin{function}{\hook_disable_generic:n}
% \begin{syntax}
-% \cs{hook_disable:n} \Arg{hook}
+% \cs{hook_disable_generic:n} \Arg{hook}
% \end{syntax}
% Marks \Arg{hook} as disabled. Any further attempt to add code to
% it or declare it, will result in an error and any call to
@@ -2479,7 +2479,7 @@
%
% \subsubsection{Disabling and providing hooks}
%
-% \begin{macro}{\hook_disable:n}
+% \begin{macro}{\hook_disable_generic:n}
% \begin{macro}{\@@_disable:n}
% \begin{macro}[pTF]{\@@_if_disabled:n}
%
@@ -2495,11 +2495,11 @@
%
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2021/06/01}%
-%<latexrelease> {\hook_disable:n}{Disable~hooks}
+%<latexrelease> {\hook_disable_generic:n}{Disable~hooks}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \hook_disable:n #1
+\cs_new_protected:Npn \hook_disable_generic:n #1
{ \@@_normalize_hook_args:Nn \@@_disable:n {#1} }
\cs_new_protected:Npn \@@_disable:n #1
{
@@ -2519,9 +2519,9 @@
%
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2020/10/01}
-%<latexrelease> {\hook_disable:n}{Disable~hooks}
+%<latexrelease> {\hook_disable_generic:n}{Disable~hooks}
%<latexrelease>
-%<latexrelease>\cs_new_protected:Npn \hook_disable:n #1 {}
+%<latexrelease>\cs_new_protected:Npn \hook_disable_generic:n #1 {}
%<latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
@@ -4654,7 +4654,7 @@
{ Cannot~add~code~to~disabled~hook~'#1'. }
{
The~hook~'#1'~you~tried~to~add~code~to~was~previously~disabled~
- with~\iow_char:N\\hook_disable:n~or~\iow_char:N\\DisableGenericHook,~so~
+ with~\iow_char:N\\hook_disable_generic:n~or~\iow_char:N\\DisableGenericHook,~so~
it~cannot~have~code~added~to~it.
}
% \end{macrocode}
@@ -4800,7 +4800,7 @@
% \begin{macro}{\DisableGenericHook}
% Disabling a (generic) hook.
% \begin{macrocode}
-\NewDocumentCommand \DisableGenericHook { m }{ \hook_disable:n {#1} }
+\NewDocumentCommand \DisableGenericHook { m }{ \hook_disable_generic:n {#1} }
% \end{macrocode}
% \end{macro}
%
diff --git a/base/testfiles-lthooks/ltcmdhooks-008.tlg b/base/testfiles-lthooks/ltcmdhooks-008.tlg
index 0b7744f1..8d884121 100644
--- a/base/testfiles-lthooks/ltcmdhooks-008.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-008.tlg
@@ -36,7 +36,8 @@ For immediate help type H <return>.
l. ...\AddToHook{\foo}{after}
\ShowHook{\foo}
The hook 'foo' you tried to add code to was previously disabled with
-\hook_disable:n or \DisableGenericHook, so it cannot have code added to it.
+\hook_disable_generic:n or \DisableGenericHook, so it cannot have code added
+to it.
-> The hook 'foo':
> The hook is not declared.
> The hook is disabled.
@@ -108,7 +109,8 @@ For immediate help type H <return>.
l. ...\AddToHookNext{\foo}{after}
\ShowHook{\foo}
The hook 'baz' you tried to add code to was previously disabled with
-\hook_disable:n or \DisableGenericHook, so it cannot have code added to it.
+\hook_disable_generic:n or \DisableGenericHook, so it cannot have code added
+to it.
-> The hook 'baz':
> The hook is not declared.
> The hook is disabled.
@@ -128,8 +130,8 @@ For immediate help type H <return>.
l. ...\AddToHookNext{\foo}{after}
\ShowHook{\foo}
The hook 'env/foo/before' you tried to add code to was previously disabled
-with \hook_disable:n or \DisableGenericHook, so it cannot have code added to
-it.
+with \hook_disable_generic:n or \DisableGenericHook, so it cannot have code
+added to it.
-> The hook 'env/foo/before':
> The hook is not declared.
> The hook is disabled.
@@ -149,8 +151,8 @@ For immediate help type H <return>.
l. ...\AddToHook{\foo}{after}
\ShowHook{\foo}
The hook 'cmd/test/before' you tried to add code to was previously disabled
-with \hook_disable:n or \DisableGenericHook, so it cannot have code added to
-it.
+with \hook_disable_generic:n or \DisableGenericHook, so it cannot have code
+added to it.
-> The hook 'cmd/test/before':
> The hook is not declared.
> The hook is disabled.
@@ -176,8 +178,8 @@ For immediate help type H <return>.
...
l. ...\AddToHook{\foo}{\ERROR 3}
The hook 'cmd/mycmd/after' you tried to add code to was previously disabled
-with \hook_disable:n or \DisableGenericHook, so it cannot have code added to
-it.
+with \hook_disable_generic:n or \DisableGenericHook, so it cannot have code
+added to it.
-> The hook 'cmd/mycmd/after':
> The hook is not declared.
> The hook is disabled.
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
index b9a379c0..98dbf3ca 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -24,7 +24,8 @@ For immediate help type H <return>.
...
l. ...\AddToHook{yyy}{error}
The hook 'yyy' you tried to add code to was previously disabled with
-\hook_disable:n or \DisableGenericHook, so it cannot have code added to it.
+\hook_disable_generic:n or \DisableGenericHook, so it cannot have code added
+to it.
! Undefined control sequence.
<argument> \::error
! hooks: Empty code label on line .... Using 'top-level' ...
@@ -39,7 +40,8 @@ For immediate help type H <return>.
...
l. ...\AddToHook{yyy}[]{error}
The hook 'yyy' you tried to add code to was previously disabled with
-\hook_disable:n or \DisableGenericHook, so it cannot have code added to it.
+\hook_disable_generic:n or \DisableGenericHook, so it cannot have code added
+to it.
! LaTeX hooks Error: Missing (empty) default label on line ....
(hooks) This command was ignored.
Type <return> to continue.
More information about the latex3-commits
mailing list.