From ee18fc4164f5a8cb737a16c26e27cd83e66b7f3f Mon Sep 17 00:00:00 2001 From: Frank Mittelbach Date: Sun, 1 Aug 2021 18:59:49 +0200 Subject: [PATCH] \DisableHook -> \DisableGenericHook --- 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 d7327c193..93ed92074 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 @@ %\def \NewReversedHook#1{} %\def \NewMirroredHookPair#1#2{} % -%\def \DisableHook #1{} +%\def \DisableGenericHook #1{} % %\long\def\AddToHookNext#1#2{} % diff --git a/base/testfiles-lthooks/ltcmdhooks-008.lvt b/base/testfiles-lthooks/ltcmdhooks-008.lvt index e533f53fe..467ff87df 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 f544102dd..0b7744f1f 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. } -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 . ... 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. } -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. } -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 . ... 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. } -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 . ... 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. } -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 . ... 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 . ... 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 0ed2a9b9a..8be5ffbba 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 90c44be13..34ae8f9a3 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 e02197241..b9a379c00 100644 --- a/base/testfiles-lthooks/lthooks-errors.tlg +++ b/base/testfiles-lthooks/lthooks-errors.tlg @@ -24,7 +24,7 @@ For immediate help type H . ... 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. \::error ! hooks: Empty code label on line .... Using 'top-level' ... @@ -39,7 +39,7 @@ For immediate help type H . ... 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 to continue.