[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks-doc-updates: prepare fore deprecation of various \Provide...Hook commands (c720358c)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Aug 2 19:00:05 CEST 2021


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

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

commit c720358c326ce3509572987a571888dfb78d538d
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Aug 2 19:00:05 2021 +0200

    prepare fore deprecation of various \Provide...Hook commands


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

c720358c326ce3509572987a571888dfb78d538d
 base/generic-hook-tasks.md                         |  23 ++++
 base/lthooks.dtx                                   | 135 ++++++++++-----------
 ...{lthooks-029.lvt => lthooks-029-deprecated.lvt} |   0
 ...{lthooks-029.tlg => lthooks-029-deprecated.tlg} |   8 +-
 base/testfiles-lthooks/lthooks-029.lvt             |  26 ++--
 base/testfiles-lthooks/lthooks-029.tlg             |  52 ++------
 ...ks-errors.lvt => lthooks-errors-deprecated.lvt} |   0
 ...ks-errors.tlg => lthooks-errors-deprecated.tlg} |  10 +-
 base/testfiles-lthooks/lthooks-errors.lvt          |  11 +-
 base/testfiles-lthooks/lthooks-errors.tlg          |  32 +----
 base/update-lthooks-tests.sh                       |   2 +
 11 files changed, 131 insertions(+), 168 deletions(-)

diff --git a/base/generic-hook-tasks.md b/base/generic-hook-tasks.md
new file mode 100644
index 00000000..c20649e4
--- /dev/null
+++ b/base/generic-hook-tasks.md
@@ -0,0 +1,23 @@
+
+## Open tasks for adjusting hooks support for generic hooks
+
+- provide deprecation commands for
+
+    - \ProvideHook
+    - \ProvideReversedHook
+    - \ProvideHookPair
+    - \hook_provide:n
+    - \hook_provide_reversed:n
+    - \hook_provide_pair:n
+
+
+- simplify logic:
+
+    - if activation only works on normal hooks the logic for checking
+      and executing could be made simpler in the future
+
+
+- test files
+
+    - lthooks-029 needs cleanup
+    - lthooks-error needs cleanup
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index d9337e6f..f880553e 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -141,7 +141,7 @@
 %     \cs{NewHook} \Arg{hook}
 %   \end{syntax}
 %   Creates a new \meta{hook}.
-%    If this is a hook provided as part of a package it is suggested
+%    If this is a hook declared as part of a package it is suggested
 %    that the \meta{hook} name is always structured as follows:
 %    \meta{package-name}\texttt{/}\meta{hook-name}. If necessary you
 %    can further subdivide the name by adding more \texttt{/} parts.
@@ -208,30 +208,17 @@
 %   \begin{syntax}
 %     \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
-%    in special situations, e.g., when  command of another package
-%    need to be altered and it is is not clear if for that command a
-%    generic hook was already explicitly declared before.
-%
-%    Normally \cs{NewHook} should be used instead.
+%    This delcaration activates a generic hook provided by a package/class
+%    (e.g., one the is used in code with \cs{UseHook} or
+%    \cs{UseOnteTimeHook} without it being explicitly declared with
+%    \cs{NewHook}).
+%    If already activated it does nothing.
+%
+%    See section~\ref{sec:?} for a discussion when this declaration is
+%    appropriate.
 % \end{function}
 %
-% \begin{function}{\ProvideReversedHook}
-%   \begin{syntax}
-%     \cs{ProvideReversedHook} \Arg{hook}
-%   \end{syntax}
-%   Like \cs{NewReversedHook} but does nothing if the hook was
-%    previously declared as a reversed hook.
-% \end{function}
 %
-% \begin{function}{\ProvideMirroredHookPair}
-%   \begin{syntax}
-%     \cs{ProvideMirroredHookPair} \Arg{hook-1} \Arg{hook-2}
-%   \end{syntax}
-%     A shorthand for
-%    \cs{ActivateGenericHook}\Arg{hook-1}\cs{ProvideReversedHook}\Arg{hook-2}.
-% \end{function}
 %
 %
 %
@@ -973,21 +960,6 @@
 %    Normally \cs{hook_new:n} should be used instead.
 % \end{function}
 %
-% \begin{function}{\hook_provide_reversed:n}
-%   \begin{syntax}
-%     \cs{hook_provide_reversed:n} \Arg{hook}
-%   \end{syntax}
-%   Like \cs{hook_new_reversed:n} but does nothing if the hook was
-%    previously declared as a reversed hook.
-% \end{function}
-%
-% \begin{function}{\hook_provide_pair:nn}
-%   \begin{syntax}
-%     \cs{hook_provide_pair:nn} \Arg{hook-1} \Arg{hook-2}
-%   \end{syntax}
-%     A shorthand for
-%    \cs{hook_activate_generic:n}\Arg{hook-1}\cs{hook_provide_reversed:n}\Arg{hook-2}.
-% \end{function}
 %
 %
 %
@@ -2530,13 +2502,10 @@
 % \end{macro}
 %
 % \begin{macro}{\hook_activate_generic:n}
-% \begin{macro}{\hook_provide_reversed:n}
 % \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_activate_generic:n}{Providing~hooks}
@@ -2545,19 +2514,17 @@
 %    \begin{macrocode}
 \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 \@@_activate_generic:nn {#1} { - } }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_activate_generic:nn #1 #2
   {
 %    \end{macrocode}
-%    If the hook to be provided was disabled we warn (for now --- this
+%    If the hook to be activated was disabled we warn (for now --- this
 %    may change).
 %    \begin{macrocode}
     \@@_if_disabled:nTF {#1}
-      { \msg_warning:nnn { hooks } { provide-disabled } {#1} }
+      { \msg_warning:nnn { hooks } { activate-disabled } {#1} }
 %    \end{macrocode}
 %    Otherwise we check if it was already declared.
 %    \begin{macrocode}
@@ -2565,11 +2532,12 @@
         \@@_if_declared:nTF {#1}
           {
 %    \end{macrocode}
-%    Issue an error if we try to provide a a hook that is reversed and
+%    Issue an error if we try to activate a hook that is reversed and
 %    the already existing one is not (or vice versa).
+% \fmiinline{should be possible to simplify here}            
 %    \begin{macrocode}
             \str_if_eq:eeF { \tl_use:c { g_@@_#1_reversed_tl } } {#2}
-              { \msg_error:nnn { hooks } { provide-error } {#1} }
+              { \msg_error:nnn { hooks } { activate-error } {#1} }
           }
 %    \end{macrocode}
 %    If it wasn't declared, we declared as a normal or reversed hook
@@ -2585,15 +2553,7 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
-% \begin{macro}{\hook_provide_pair:nn}
-%    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_activate_generic:n {#1} \hook_provide_reversed:n {#2} }
-%    \end{macrocode}
-% \end{macro}
 %
 %    \begin{macrocode}
 %<latexrelease>\EndIncludeInRelease
@@ -2603,9 +2563,7 @@
 %<latexrelease>\IncludeInRelease{2020/10/01}
 %<latexrelease>                 {\hook_activate_generic:n}{Providing~hooks}
 %<latexrelease>
-%<latexrelease>\cs_new_protected:Npn \hook_provide_reversed: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
 %    \end{macrocode}
@@ -3678,8 +3636,8 @@
 %    alphanumeric labels. As usual Don's data structures are chosen in
 %    a way that one can omit a lot of tests and I have mimicked that as
 %    far as possible. The result is a restriction I do not test for at
-%    the moment: a label can't be equal to the number 0!  \fmi{Needs
-%    checking for, just in case ... maybe}
+%    the moment: a label can't be equal to the number 0!
+%  \fmiinline{Needs checking for, just in case ... maybe}
 %
 %    ^^A #1 <- \@@~#1
 %    ^^A #2 <- \g_@@_#1_labels_clist
@@ -3820,7 +3778,7 @@
 %    \end{macrocode}
 %
 %    This is not really the information one needs in the error case
-%    but will do for now \ldots \fmi{improve output on a rainy day}
+%    but will do for now \ldots \fmiinline{improve output on a rainy day}
 %    \begin{macrocode}
         \@@_debug_label_data:N \l_@@_work_prop
         \iow_term:x{====================}
@@ -4740,20 +4698,21 @@
 %
 %
 %    \begin{macrocode}
-\msg_new:nnn { hooks } { provide-disabled }
+\msg_new:nnn { hooks } { activate-disabled }
   {
-    Cannot~ provide~ hook~ '#1'~ because~ it~ is~ disabled!
+    Cannot~ activate~ hook~ '#1'~ because~ it~ is~ disabled!
   }
 %    \end{macrocode}
 %
+% \fmiinline{that should be simplified now}
 %    \begin{macrocode}
-\msg_new:nnnn { hooks } { provide-error }
+\msg_new:nnnn { hooks } { activate-error }
   {
     Hook~'#1'~ already~ declared~ as~ a~
     \@@_if_reversed:nTF {#1} { reversed } { normal }~ hook!
   }
   {
-    You~ attempted~ to~ provide~ the~ hook~'#1'~ as~ a~
+    You~ attempted~ to~ activate~ the~ hook~'#1'~ as~ a~
     \@@_if_reversed:nTF {#1} { normal } { reversed }~ hook,~ but~ it~
     was~ already~ previously~ declared~ as~ a~
     \@@_if_reversed:nTF {#1} { reversed } { normal }~ hook.~
@@ -4786,19 +4745,19 @@
 %<latexrelease>         {\hook_activate_generic:n}{Providing~hooks}
 %    \end{macrocode}
 %
-%  \begin{macro}{\ActivateGenericHook,\ProvideReversedHook,\ProvideMirroredHookPair}
+%  \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 \ProvideReversedHook { m }{ \hook_provide_reversed:n {#1} }
-\NewDocumentCommand \ProvideMirroredHookPair { mm }{ \hook_provide_pair:nn {#1}{#2} }
+\NewDocumentCommand \ActivateGenericHook{ m }{ \hook_activate_generic:n {#1} }
 %    \end{macrocode}
 %  \end{macro}
 %
 %
 %  \begin{macro}{\DisableGenericHook}
-%    Disabling a (generic) hook.
+%    Disabling a generic hook.
+% \changes{v1.0o}{2021/08/02}{Change name}
 %    \begin{macrocode}
 \NewDocumentCommand \DisableGenericHook { m }{ \hook_disable_generic:n {#1} }
 %    \end{macrocode}
@@ -4810,8 +4769,6 @@
 %<latexrelease>                 {\hook_activate_generic:n}{Providing~hooks}
 %<latexrelease>
 %<latexrelease>\def \ActivateGenericHook#1{}
-%<latexrelease>\def \ProvideReversedHook#1{}
-%<latexrelease>\def \ProvideMirroredHookPair#1#2{}
 %<latexrelease>
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
@@ -5113,6 +5070,44 @@
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
+%  \subsection{Deprecated that needs cleanup \ldots}
+%
+% \fmiinline{these should give a deprecation warning now}
+%
+% \begin{macro}{\@@_activate_generic_reversed:n}
+%    Deprecated.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_activate_generic_reversed:n #1
+  { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} { - } }
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@@_activate_generic_pair:nn}
+%    Deprecated.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_activate_generic_pair:nn #1#2
+  { \hook_activate_generic:n {#1} \@@_activate_generic_reversed:n {#2} }
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%  \begin{macro}{\ProvideReversedHook,\ProvideMirroredHookPair}
+%    Deprecated.
+%    \begin{macrocode}
+\NewDocumentCommand \ProvideReversedHook { m }{ \@@_activate_generic_reversed:n {#1} }
+\NewDocumentCommand \ProvideMirroredHookPair { mm }{ \@@_activate_generic_pair:nn {#1}{#2} }
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%
+%
+%
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
 %
 % \subsection{Internal commands needed elsewhere}
 %
diff --git a/base/testfiles-lthooks/lthooks-029.lvt b/base/testfiles-lthooks/lthooks-029-deprecated.lvt
similarity index 100%
copy from base/testfiles-lthooks/lthooks-029.lvt
copy to base/testfiles-lthooks/lthooks-029-deprecated.lvt
diff --git a/base/testfiles-lthooks/lthooks-029.tlg b/base/testfiles-lthooks/lthooks-029-deprecated.tlg
similarity index 91%
copy from base/testfiles-lthooks/lthooks-029.tlg
copy to base/testfiles-lthooks/lthooks-029-deprecated.tlg
index 37a262b3..8faac2a3 100644
--- a/base/testfiles-lthooks/lthooks-029.tlg
+++ b/base/testfiles-lthooks/lthooks-029-deprecated.tlg
@@ -95,8 +95,8 @@ l. ...\ShowHook{ccc}
 For immediate help type H <return>.
  ...                                              
 l. ...\ProvideReversedHook{aaa}
-You attempted to provide the hook 'aaa' as a reversed hook, but it was already
-previously declared as a normal hook. A redeclaration is not possible.
+You attempted to activate the hook 'aaa' as a reversed hook, but it was
+already previously declared as a normal hook. A redeclaration is not possible.
 -> The hook 'aaa':
 > Code chunks:
 >     X -> X1
@@ -115,7 +115,7 @@ l. ...\ShowHook{aaa}
 For immediate help type H <return>.
  ...                                              
 l. ...\ActivateGenericHook{ccc}
-You attempted to provide the hook 'ccc' as a normal hook, but it was already
+You attempted to activate 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':
 > Code chunks:
@@ -131,7 +131,7 @@ previously declared as a reversed hook. A redeclaration is not possible.
 <recently read> }
 l. ...\ShowHook{ccc}
 ------------ provide hook that was disabled --------------
-LaTeX hooks Warning: Cannot provide hook 'ddd' because it is disabled!
+LaTeX hooks Warning: Cannot activate hook 'ddd' because it is disabled!
 -> The hook 'ddd':
 > 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 371a77c2..e2a19005 100644
--- a/base/testfiles-lthooks/lthooks-029.lvt
+++ b/base/testfiles-lthooks/lthooks-029.lvt
@@ -18,12 +18,12 @@
 \NewHook{aaa}
 \ShowHook{aaa}
 
-\typeout{------------ provide a known hook --------------}
+\typeout{------------ activate a known hook --------------}
 
 \ActivateGenericHook{aaa}
 \ShowHook{aaa}
 
-\typeout{------------ provide a known hook with data --------------}
+\typeout{------------ activate a known hook with data --------------}
 
 \AddToHook{aaa}[X]{X1}
 
@@ -32,41 +32,37 @@
 
 \AddToHook{bbb}[Y]{Y1}
 
-\typeout{------------ provide an unknown hook with data --------------}
+\typeout{------------ activate an unknown hook with data --------------}
 
 \ActivateGenericHook{bbb}
 \ShowHook{bbb}
 \ActivateGenericHook{bbb}
 \ShowHook{bbb}
 
-\typeout{------------ provide an unknown reversed hook --------------}
+\typeout{------------ activate an unknown reversed hook --------------}
 
-\NewReversedHook{ccc}
+\ActivateGenericHook{ccc}
 \ShowHook{ccc}
 
-\typeout{------------ provide an known reversed hook --------------}
+\typeout{------------ activate an known reversed hook --------------}
 
-\ProvideReversedHook{ccc}
+\ActivateGenericHook{ccc}
 \ShowHook{ccc}
 
 \AddToHook{ccc}[Z]{Z1}
 
-\typeout{------------ provide an known reversed hook with data --------------}
+\typeout{------------ activate an known reversed hook with data --------------}
 
-\ProvideReversedHook{ccc}
+\ActivateGenericHook{ccc}
 \ShowHook{ccc}
 
-\typeout{------------ provide an reversed hook on an existing normal hook --------------}
-
-\ProvideReversedHook{aaa}
-\ShowHook{aaa}
 
-\typeout{------------ provide an normal hook on an existing reversed hook --------------}
+\typeout{------------ activate an normal hook on an existing reversed hook --------------}
 
 \ActivateGenericHook{ccc}
 \ShowHook{ccc}
 
-\typeout{------------ provide hook that was disabled --------------}
+\typeout{------------ activate hook that was disabled --------------}
 
 \DisableGenericHook{ddd}
 \ActivateGenericHook{ddd}
diff --git a/base/testfiles-lthooks/lthooks-029.tlg b/base/testfiles-lthooks/lthooks-029.tlg
index 37a262b3..300bbd10 100644
--- a/base/testfiles-lthooks/lthooks-029.tlg
+++ b/base/testfiles-lthooks/lthooks-029.tlg
@@ -20,12 +20,12 @@ l. ...\ShowHook{ccc}
 > The hook is empty.
 <recently read> }
 l. ...\ShowHook{aaa}
------------- provide a known hook --------------
+------------ activate a known hook --------------
 -> The hook 'aaa':
 > The hook is empty.
 <recently read> }
 l. ...\ShowHook{aaa}
------------- provide a known hook with data --------------
+------------ activate a known hook with data --------------
 -> The hook 'aaa':
 > Code chunks:
 >     X -> X1
@@ -39,7 +39,7 @@ l. ...\ShowHook{aaa}
 >     X.
 <recently read> }
 l. ...\ShowHook{aaa}
------------- provide an unknown hook with data --------------
+------------ activate an unknown hook with data --------------
 -> The hook 'bbb':
 > Code chunks:
 >     Y -> Y1
@@ -66,40 +66,20 @@ l. ...\ShowHook{bbb}
 >     Y.
 <recently read> }
 l. ...\ShowHook{bbb}
------------- provide an unknown reversed hook --------------
+------------ activate an unknown reversed hook --------------
 -> The hook 'ccc':
 > The hook is empty.
 <recently read> }
 l. ...\ShowHook{ccc}
------------- provide an known reversed hook --------------
+------------ activate an known reversed hook --------------
 -> The hook 'ccc':
 > The hook is empty.
 <recently read> }
 l. ...\ShowHook{ccc}
------------- provide an known reversed hook with data --------------
+------------ activate an known reversed hook with data --------------
 -> The hook 'ccc':
 > Code chunks:
 >     Z -> Z1
-> Document-level (top-level) code (executed first):
->     ---
-> Extra code for next invocation:
->     ---
-> Rules:
->     ---
-> Execution order (after reversal):
->     Z.
-<recently read> }
-l. ...\ShowHook{ccc}
------------- provide an reversed hook on an existing normal hook --------------
-! LaTeX hooks Error: Hook 'aaa' already declared as a normal hook!
-For immediate help type H <return>.
- ...                                              
-l. ...\ProvideReversedHook{aaa}
-You attempted to provide the hook 'aaa' as a reversed hook, but it was already
-previously declared as a normal hook. A redeclaration is not possible.
--> The hook 'aaa':
-> Code chunks:
->     X -> X1
 > Document-level (top-level) code (executed last):
 >     ---
 > Extra code for next invocation:
@@ -107,31 +87,25 @@ previously declared as a normal hook. A redeclaration is not possible.
 > Rules:
 >     ---
 > Execution order:
->     X.
+>     Z.
 <recently read> }
-l. ...\ShowHook{aaa}
------------- provide an normal hook on an existing reversed hook --------------
-! LaTeX hooks Error: Hook 'ccc' already declared as a reversed hook!
-For immediate help type H <return>.
- ...                                              
-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.
+l. ...\ShowHook{ccc}
+------------ activate an normal hook on an existing reversed hook --------------
 -> The hook 'ccc':
 > Code chunks:
 >     Z -> Z1
-> Document-level (top-level) code (executed first):
+> Document-level (top-level) code (executed last):
 >     ---
 > Extra code for next invocation:
 >     ---
 > Rules:
 >     ---
-> Execution order (after reversal):
+> Execution order:
 >     Z.
 <recently read> }
 l. ...\ShowHook{ccc}
------------- provide hook that was disabled --------------
-LaTeX hooks Warning: Cannot provide hook 'ddd' because it is disabled!
+------------ activate hook that was disabled --------------
+LaTeX hooks Warning: Cannot activate hook 'ddd' because it is disabled!
 -> The hook 'ddd':
 > The hook is not declared.
 > The hook is disabled.
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors-deprecated.lvt
similarity index 100%
copy from base/testfiles-lthooks/lthooks-errors.lvt
copy to base/testfiles-lthooks/lthooks-errors-deprecated.lvt
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors-deprecated.tlg
similarity index 95%
copy from base/testfiles-lthooks/lthooks-errors.tlg
copy to base/testfiles-lthooks/lthooks-errors-deprecated.tlg
index ff13e831..1cc79916 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors-deprecated.tlg
@@ -10,15 +10,15 @@ Please use a different name for your hook.
 For immediate help type H <return>.
  ...                                              
 l. ...\ProvideReversedHook{xxx}
-You attempted to provide the hook 'xxx' as a reversed hook, but it was already
-previously declared as a normal hook. A redeclaration is not possible.
+You attempted to activate the hook 'xxx' as a reversed hook, but it was
+already 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. ...\ActivateGenericHook{yyy}
-You attempted to provide the hook 'yyy' as a normal hook, but it was already
+You attempted to activate 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!
+LaTeX hooks Warning: Cannot activate hook 'yyy' because it is disabled!
 ! LaTeX hooks Error: Cannot add code to disabled hook 'yyy'.
 For immediate help type H <return>.
  ...                                              
@@ -156,4 +156,4 @@ l. ...\end{document}
 LaTeX does not know anything more about this error, sorry.
 Try typing <return> to proceed.
 If that doesn't work, type X <return> to quit.
-(lthooks-errors.aux)
+(lthooks-errors-deprecated.aux)
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors.lvt
index dc5d1ce6..1aed50bf 100644
--- a/base/testfiles-lthooks/lthooks-errors.lvt
+++ b/base/testfiles-lthooks/lthooks-errors.lvt
@@ -10,21 +10,14 @@
 
 \START
 
-\NewHook{xxx}
-
-% exists
-\NewHook{xxx}
-
-% provide-error
-\ProvideReversedHook{xxx}
 
 \NewReversedHook{yyy}
 
-% provide-error
+% activate-error
 \ActivateGenericHook{yyy}
 \DisableGenericHook{yyy}
 
-% provide-disabled
+% activate-disabled
 \ActivateGenericHook{yyy}
 
 % hook-disabled
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
index ff13e831..c9e34c94 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -1,24 +1,12 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-! LaTeX hooks Error: Hook 'xxx' has already been declared.
-For immediate help type H <return>.
- ...                                              
-l. ...\NewHook{xxx}
-There already exists a hook declaration with this name.
-Please use a different name for your hook.
-! LaTeX hooks Error: Hook 'xxx' already declared as a normal hook!
-For immediate help type H <return>.
- ...                                              
-l. ...\ProvideReversedHook{xxx}
-You attempted to provide the hook 'xxx' as a reversed hook, but it was already
-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. ...\ActivateGenericHook{yyy}
-You attempted to provide the hook 'yyy' as a normal hook, but it was already
+You attempted to activate 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!
+LaTeX hooks Warning: Cannot activate hook 'yyy' because it is disabled!
 ! LaTeX hooks Error: Cannot add code to disabled hook 'yyy'.
 For immediate help type H <return>.
  ...                                              
@@ -58,31 +46,23 @@ l. ......HookRule {xxx} {label1} {unknown} {label2}
 The relation used not known to the system. Allowed values are 'before' or '<',
 'after' or '>', 'incompatible-warning', 'incompatible-error', 'voids' or
 'unrelated'.
-LaTeX hooks Warning: Labels 'label4' and 'label3' are incompatible in hook
-(hooks)              'xxx'. You may see errors later.
-! LaTeX hooks Error: Labels 'label5' and 'label1' are incompatible in hook
-(hooks)              'xxx'. The code for both labels will be dropped.
-For immediate help type H <return>.
- ...                                              
-l. ...\LogHook{xxx}
-LaTeX found two incompatible labels in the same hook. This indicates an
-incompatibility between packages.
 -> The hook 'xxx':
+> The hook is not declared.
 > Code chunks:
 >     label1 ->  foo1
 >     label2 ->  foo2
 >     label3 ->  foo2
 >     label4 ->  foo3
 >     label5 ->  foo5
-> Document-level (top-level) code (executed last):
+> Document-level (top-level) code:
 >     ---
 > Extra code for next invocation:
 >     ---
 > Rules:
 >     label4|label3 with relation xW
 >     label5|label1 with relation xE
-> Execution order (after applying rules):
->     label1, label2, label3, label4, label5.
+> Execution order:
+>     Not set because the hook is undeclared.
 ! LaTeX kernel Error: This should not happen. Tried to pop from an empty file
 (kernel)              name stack.
 (kernel)              Please report at https://github.com/latex3/latex2e.
diff --git a/base/update-lthooks-tests.sh b/base/update-lthooks-tests.sh
index 1fe64f15..2b8176f8 100644
--- a/base/update-lthooks-tests.sh
+++ b/base/update-lthooks-tests.sh
@@ -79,7 +79,9 @@ l3build save -cconfig-lthooks \
    lthooks-027 \
    lthooks-028 \
    lthooks-029 \
+   lthooks-029-deprecated \
    lthooks-errors \
+   lthooks-errors-deprecated \
    lthooks-etoolbox \
    lthooks-legacy \
    lthooks-doc-examples \





More information about the latex3-commits mailing list.