[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks-doc-updates: \DisableHook -> \DisableGenericHook (ee18fc41)
Frank Mittelbach
frank.mittelbach at latex-project.org
Sun Aug 1 18:59:49 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : lthooks-doc-updates
Link : https://github.com/latex3/latex2e/commit/ee18fc4164f5a8cb737a16c26e27cd83e66b7f3f
>---------------------------------------------------------------
commit ee18fc4164f5a8cb737a16c26e27cd83e66b7f3f
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Sun Aug 1 18:59:49 2021 +0200
\DisableHook -> \DisableGenericHook
>---------------------------------------------------------------
ee18fc4164f5a8cb737a16c26e27cd83e66b7f3f
base/lthooks.dtx | 16 ++++++++--------
base/testfiles-lthooks/ltcmdhooks-008.lvt | 12 ++++++------
base/testfiles-lthooks/ltcmdhooks-008.tlg | 23 +++++++++++++----------
base/testfiles-lthooks/lthooks-029.lvt | 2 +-
base/testfiles-lthooks/lthooks-errors.lvt | 2 +-
base/testfiles-lthooks/lthooks-errors.tlg | 4 ++--
6 files changed, 31 insertions(+), 28 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index d7327c19..93ed9207 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -180,15 +180,15 @@
% \end{function}
%
%
-% \subsubsection{Special declarations for hooks}
+% \subsubsection{Special declarations for generic hooks}
%
% The declarations here should normally not be used. They are available
% to provide support for special use cases mainly involving
% generic command hooks.
%
-% \begin{function}{\DisableHook}
+% \begin{function}{\DisableGenericHook}
% \begin{syntax}
-% \cs{DisableHook} \Arg{hook}
+% \cs{DisableGenericHook} \Arg{hook}
% \end{syntax}
% After this declaration the \meta{hook} is no longer usable: Any
% attempt to add further code to it will result in an error and any
@@ -2260,7 +2260,7 @@
% \item[disabled]
%
% A hook in any state is moved to this state when
-% \cs{DisableHook} is used. This changes the tests to give the
+% \cs{DisableGenericHook} is used. This changes the tests to give the
% following results:
% \begin{itemize}
% \item [@@_if_structure_exist:nTF] \emph{unchanged}.
@@ -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\\DisableHook,~so~
+ with~\iow_char:N\\hook_disable:n~or~\iow_char:N\\DisableGenericHook,~so~
it~cannot~have~code~added~to~it.
}
% \end{macrocode}
@@ -4797,10 +4797,10 @@
% \end{macro}
%
%
-% \begin{macro}{\DisableHook}
+% \begin{macro}{\DisableGenericHook}
% Disabling a (generic) hook.
% \begin{macrocode}
-\NewDocumentCommand \DisableHook { m }{ \hook_disable:n {#1} }
+\NewDocumentCommand \DisableGenericHook { m }{ \hook_disable:n {#1} }
% \end{macrocode}
% \end{macro}
%
@@ -5156,7 +5156,7 @@
%<latexrelease>\def \NewReversedHook#1{}
%<latexrelease>\def \NewMirroredHookPair#1#2{}
%<latexrelease>
-%<latexrelease>\def \DisableHook #1{}
+%<latexrelease>\def \DisableGenericHook #1{}
%<latexrelease>
%<latexrelease>\long\def\AddToHookNext#1#2{}
%<latexrelease>
diff --git a/base/testfiles-lthooks/ltcmdhooks-008.lvt b/base/testfiles-lthooks/ltcmdhooks-008.lvt
index e533f53f..467ff87d 100644
--- a/base/testfiles-lthooks/ltcmdhooks-008.lvt
+++ b/base/testfiles-lthooks/ltcmdhooks-008.lvt
@@ -11,7 +11,7 @@
\def\foo{foo}
\AddToHook{\foo}{before} \ShowHook{\foo}
-\DisableHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHook{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
@@ -19,24 +19,24 @@
\AddToHook{\foo}{before} \ShowHook{\foo}
\NewHook{\foo} \ShowHook{\foo}
-\DisableHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\typeout{=================================}
\def\foo{baz}
-\DisableHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHookNext{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
\def\foo{env/foo/before}
-\DisableHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHookNext{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
\def\foo{cmd/test/before}
-\DisableHook{\foo} \ShowHook{\foo}
+\DisableGenericHook{\foo} \ShowHook{\foo}
\AddToHook{\foo}{after} \ShowHook{\foo}
\typeout{=================================}
@@ -53,7 +53,7 @@
\ShowHook{\foo}
% This won't work, so we disable...
-\DisableHook{\foo}
+\DisableGenericHook{\foo}
% ... and try adding even more code nonetheless :)
\AddToHook{\foo}{\ERROR 3}
diff --git a/base/testfiles-lthooks/ltcmdhooks-008.tlg b/base/testfiles-lthooks/ltcmdhooks-008.tlg
index f544102d..0b7744f1 100644
--- a/base/testfiles-lthooks/ltcmdhooks-008.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-008.tlg
@@ -29,14 +29,14 @@ l. ...\AddToHook{\foo}{before} \ShowHook{\foo}
> Execution order:
> Not set because the hook is disabled.
<recently read> }
-l. ...\DisableHook{\foo} \ShowHook{\foo}
+l. ......GenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'foo'.
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 \DisableHook, so it cannot have code added to it.
+\hook_disable:n or \DisableGenericHook, so it cannot have code added to it.
-> The hook 'foo':
> The hook is not declared.
> The hook is disabled.
@@ -94,21 +94,21 @@ l. ...\NewHook{\foo} \ShowHook{\foo}
> Execution order:
> Not set because the hook is disabled.
<recently read> }
-l. ...\DisableHook{\foo} \ShowHook{\foo}
+l. ......GenericHook{\foo} \ShowHook{\foo}
=================================
-> The hook 'baz':
> The hook is not declared.
> The hook is disabled.
> The hook is empty.
<recently read> }
-l. ...\DisableHook{\foo} \ShowHook{\foo}
+l. ......GenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'baz'.
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 \DisableHook, so it cannot have code added to it.
+\hook_disable:n or \DisableGenericHook, so it cannot have code added to it.
-> The hook 'baz':
> The hook is not declared.
> The hook is disabled.
@@ -121,14 +121,15 @@ l. ...\AddToHookNext{\foo}{after} \ShowHook{\foo}
> The hook is disabled.
> The hook is empty.
<recently read> }
-l. ...\DisableHook{\foo} \ShowHook{\foo}
+l. ......GenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'env/foo/before'.
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 \DisableHook, so it cannot have code added to it.
+with \hook_disable: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.
@@ -141,14 +142,15 @@ l. ...\AddToHookNext{\foo}{after} \ShowHook{\foo}
> The hook is disabled.
> The hook is empty.
<recently read> }
-l. ...\DisableHook{\foo} \ShowHook{\foo}
+l. ......GenericHook{\foo} \ShowHook{\foo}
! LaTeX hooks Error: Cannot add code to disabled hook 'cmd/test/before'.
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 \DisableHook, so it cannot have code added to it.
+with \hook_disable: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.
@@ -174,7 +176,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 \DisableHook, so it cannot have code added to it.
+with \hook_disable: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-029.lvt b/base/testfiles-lthooks/lthooks-029.lvt
index 0ed2a9b9..8be5ffbb 100644
--- a/base/testfiles-lthooks/lthooks-029.lvt
+++ b/base/testfiles-lthooks/lthooks-029.lvt
@@ -68,7 +68,7 @@
\typeout{------------ provide hook that was disabled --------------}
-\DisableHook{ddd}
+\DisableGenericHook{ddd}
\ProvideHook{ddd}
\ShowHook{ddd}
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors.lvt
index 90c44be1..34ae8f9a 100644
--- a/base/testfiles-lthooks/lthooks-errors.lvt
+++ b/base/testfiles-lthooks/lthooks-errors.lvt
@@ -22,7 +22,7 @@
% provide-error
\ProvideHook{yyy}
-\DisableHook{yyy}
+\DisableGenericHook{yyy}
% provide-disabled
\ProvideHook{yyy}
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
index e0219724..b9a379c0 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -24,7 +24,7 @@ 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 \DisableHook, so it cannot have code added to it.
+\hook_disable: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 +39,7 @@ 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 \DisableHook, so it cannot have code added to it.
+\hook_disable: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.