[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Gh818 [lthooks] Error when a sorting rule is added to a one-time hook (#821) (ad0f86a4)

GitHub noreply at github.com
Thu May 19 10:53:42 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/ad0f86a4baa7ced17324e9ef2533c2ea4a832da2

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

commit ad0f86a4baa7ced17324e9ef2533c2ea4a832da2
Author: Phelype Oleinik <phelype.oleinik at latex-project.org>
Date:   Thu May 19 05:53:42 2022 -0300

    Gh818 [lthooks] Error when a sorting rule is added to a one-time hook (#821)
    
    * Test file showing wrong behaviour
    
    * Refuse sorting one-time hooks
    
    Fixes #818
    
    * Update test file with the correct output
    
    * Add changes.txt and ltnews35.tex entries
    
    * Add rollback for #818
    
    * Missing macrocode environments
    
    * fixed scrambled changes entries (but why does this show up now and not in other branches???)
    
    * Complain if a rule is added to an used one-time hook
    
    * Rename test files for easier referencing
    
    * IncludeInRelease the right function
    
    * some documentation changes
    
    * Improve text
    
    Co-authored-by: Frank Mittelbach <frank.mittelbach at latex-project.org>
    Co-authored-by: Joseph Wright <joseph.wright at morningstar2.co.uk>


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

ad0f86a4baa7ced17324e9ef2533c2ea4a832da2
 base/changes.txt                                   |   5 +
 base/doc/ltnews35.tex                              |  25 +++++
 base/lthooks.dtx                                   |  92 ++++++++++++++---
 base/slides.dtx                                    |   5 +-
 base/testfiles-lthooks/github-0606.tlg             |   9 ++
 base/testfiles-lthooks/github-0818.lvt             |  25 +++++
 base/testfiles-lthooks/github-0818.tlg             |  11 ++
 base/testfiles-lthooks/lthooks-031.lvt             |  40 ++++++++
 .../{filehook-003.tlg => lthooks-031.tlg}          | 113 +++++++++++----------
 base/testfiles/github-0479-often.luatex.tlg        |   2 +
 base/testfiles/github-0479-often.tlg               |   2 +
 base/testfiles/github-0479-often.xetex.tlg         |   2 +
 .../tlb-latexrelease-rollback-003-often.luatex.tlg |   4 +
 .../tlb-latexrelease-rollback-003-often.tlg        |   4 +
 .../tlb-latexrelease-rollback-003-often.xetex.tlg  |   4 +
 ...tlb-latexrelease-rollback-2020-10-01.luatex.tlg |   2 +
 .../tlb-latexrelease-rollback-2020-10-01.tlg       |   2 +
 .../tlb-latexrelease-rollback-2020-10-01.xetex.tlg |   2 +
 ...tlb-latexrelease-rollback-2021-06-01.luatex.tlg |   2 +
 .../tlb-latexrelease-rollback-2021-06-01.tlg       |   2 +
 .../tlb-latexrelease-rollback-2021-06-01.xetex.tlg |   2 +
 ...tlb-latexrelease-rollback-2021-11-15.luatex.tlg |   2 +
 .../tlb-latexrelease-rollback-2021-11-15.tlg       |   2 +
 .../tlb-latexrelease-rollback-2021-11-15.xetex.tlg |   2 +
 base/testfiles/tlb-rollback-004-often.luatex.tlg   |   2 +
 base/testfiles/tlb-rollback-004-often.tlg          |   2 +
 base/testfiles/tlb-rollback-004-often.xetex.tlg    |   2 +
 base/testfiles/tlb-rollback-005.luatex.tlg         |   2 +
 base/testfiles/tlb-rollback-005.tlg                |   2 +
 base/testfiles/tlb-rollback-005.xetex.tlg          |   2 +
 base/update-lthooks-tests.sh                       |   5 +-
 31 files changed, 308 insertions(+), 70 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 4bd004b7..a201a2a5 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2022-05-17  Phelype Oleinik  <phelype.oleinik at latex-project.org>
+
+	* lthooks.dtx (subsection{Setting rules for hooks code}):
+	Refuse sorting one-time hooks (gh/818).
+
 2022-05-17  Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 
 	* ltmeta.dtx:
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 2cb8c0d1..132dcd31 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -787,6 +787,31 @@ The old behavior can be restored by adding
 to a document.
 
 
+\subsection{Fixed bug when setting hook rules for one-time hooks}
+
+If a \cs{DeclareHookRule} command is set for a one-time hook, it has to
+come \emph{before} the hook gets used, because otherwise it never
+applies\Dash after all, the hook is used only once.  There was a bug in
+the implementation in that the sorting mechanism was still applied if
+the \cs{DeclareHookRule} declaration appeared while the one-time hook was
+executed, causing the spurious typesetting of the code labels and the
+hook name.  This bug is now fixed and an error is raised when a new
+sorting rule is added to an already used one-time hook.
+
+A possible scenario in which this new error is raised is the following:
+package \pkg{AAA} declares a hook rule for \hook{begindocument} (i.e.,
+\cs{AtBeginDocument}) to sort out the behavior between itself and some
+other package. Package \pkg{BBB} wants to load package \pkg{AAA} but
+only if it hasn't been loaded in the preamble, so delays the loading to
+\hook{begindocument}. In that case the hook rule declared by \pkg{AAA}
+can no longer be applied and you get the error. If that happens the
+solution is to load the package in \hook{begindocument/before}, which
+is executed at the very end of the preamble but before
+\hook{begindocument} is processed.
+%
+\githubissue{818}
+
+
 
 
 \section{Changes to packages in the \pkg{amsmath} category}
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index eff44672..06a0e825 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -32,7 +32,7 @@
 %
 %    \begin{macrocode}
 \def\lthooksversion{v1.0u}
-\def\lthooksdate{2022/05/13}
+\def\lthooksdate{2022/05/19}
 %    \end{macrocode}
 %
 %<*driver>
@@ -3626,6 +3626,11 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2022/06/01}{\@@_gset_rule:nnnn}
+%<latexrelease>                 {Refuse~setting~rule~for~one-time~hooks}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \cs_new_protected:Npn \@@_gset_rule:nnnn #1#2#3#4
   {
     \@@_if_deprecated_generic:nT {#1}
@@ -3633,7 +3638,13 @@
         \@@_deprecated_generic_warn:n {#1}
         \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn {#1}
           {#2} {#3} {#4}
-        \exp_after:wN \use_none:nnnnnnnnn \use_none:n
+        \@@_clean_to_scan:w
+      }
+    \@@_if_execute_immediately:nT {#1}
+      {
+        \msg_error:nnnnnn { hooks } { rule-too-late }
+          {#1} {#2} {#3} {#4}
+        \@@_clean_to_scan:w
       }
 %    \end{macrocode}
 %    First we ensure the basic data structure of the hook exists:
@@ -3652,10 +3663,41 @@
           {#1} {#2} {#4}
         \@@_update_hook_code:n {#1}
       }
-      { \msg_error:nnnnnn { hooks } { unknown-rule }
-                          {#1} {#2} {#3} {#4}        }
+      {
+        \msg_error:nnnnnn { hooks } { unknown-rule }
+          {#1} {#2} {#3} {#4}
+      }
+    \s_@@_mark
   }
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_gset_rule:nnnn}
+%<latexrelease>                 {Refuse~setting~rule~for~one-time~hooks}
+%<latexrelease>\cs_new_protected:Npn \@@_gset_rule:nnnn #1#2#3#4
+%<latexrelease>  {
+%<latexrelease>    \@@_if_deprecated_generic:nT {#1}
+%<latexrelease>      {
+%<latexrelease>        \@@_deprecated_generic_warn:n {#1}
+%<latexrelease>        \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn {#1}
+%<latexrelease>          {#2} {#3} {#4}
+%<latexrelease>        \exp_after:wN \use_none:nnnnnnnnn \use_none:n
+%<latexrelease>      }
+%<latexrelease>    \@@_init_structure:n {#1}
+%<latexrelease>    \@@_rule_gclear:nnn {#1} {#2} {#4}
+%<latexrelease>    \cs_if_exist_use:cTF { @@_rule_#3_gset:nnn }
+%<latexrelease>      {
+%<latexrelease>          {#1} {#2} {#4}
+%<latexrelease>        \@@_update_hook_code:n {#1}
+%<latexrelease>      }
+%<latexrelease>      {
+%<latexrelease>        \msg_error:nnnnnn { hooks } { unknown-rule }
+%<latexrelease>          {#1} {#2} {#3} {#4}
+%<latexrelease>      }
+%<latexrelease>  }
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
@@ -3833,7 +3875,6 @@
 %  \end{macro}
 %
 %
-%
 %  \begin{macro}{\@@_initialize_hook_code:n}
 %    Initializing or reinitializing the fast execution hook code. In
 %    the preamble this is selectively done in case a hook gets used
@@ -3842,8 +3883,8 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_initialize_hook_code:n #1
   {
-    \@@_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
-                                    '#1' \on at line :^^J} }
+    \@@_debug:n
+      { \iow_term:x { ^^J Update~code~for~hook~'#1' \on at line :^^J } }
 %    \end{macrocode}
 %    This does the sorting and the updates.
 %    First thing we do is to check if a legacy hook macro exists and
@@ -3861,6 +3902,7 @@
 %    \cs{@@_initialize_single:NNn} and pass to it ready made csnames
 %    as they are needed several times inside. This way we save a bit
 %    on processing time if we do that up front.
+% \changes{v1.0u}{2022/05/17}{Refuse sorting one-time hooks (gh/818).}
 %    \begin{macrocode}
     \@@_if_usable:nT {#1}
       {
@@ -3904,8 +3946,8 @@
 %    i.e., we are only interested in storing the keys and the value is
 %    arbitrary.
 %    \begin{macrocode}
-            \@@_debug:n{ \exp_args:NNx \prop_gput:Nnn
-                                       \g_@@_used_prop {#1}{} }
+            \@@_debug:n
+              { \exp_args:NNx \prop_gput:Nnn \g_@@_used_prop {#1} { } }
           }
       }
   }
@@ -4322,16 +4364,17 @@
 %     \@@_apply_-rule_>:nnn,
 %     \@@_apply_-rule_<-:nnn,
 %     \@@_apply_-rule_->:nnn,
-%     \@@_apply_-rule_x:nnn,
+%     \@@_apply_-rule_xW:nnn,
+%     \@@_apply_-rule_xE:nnn,
 %   }
 %   Reversed rules.
 %    \begin{macrocode}
-\cs_new_eq:cc { @@_apply_-rule_<:nnn  } { @@_apply_rule_>:nnn }
-\cs_new_eq:cc { @@_apply_-rule_>:nnn  } { @@_apply_rule_<:nnn }
+\cs_new_eq:cc { @@_apply_-rule_<:nnn } { @@_apply_rule_>:nnn }
+\cs_new_eq:cc { @@_apply_-rule_>:nnn } { @@_apply_rule_<:nnn }
 \cs_new_eq:cc { @@_apply_-rule_<-:nnn } { @@_apply_rule_<-:nnn }
 \cs_new_eq:cc { @@_apply_-rule_->:nnn } { @@_apply_rule_->:nnn }
-\cs_new_eq:cc { @@_apply_-rule_xE:nnn  } { @@_apply_rule_xE:nnn }
-\cs_new_eq:cc { @@_apply_-rule_xW:nnn  } { @@_apply_rule_xW:nnn }
+\cs_new_eq:cc { @@_apply_-rule_xE:nnn } { @@_apply_rule_xE:nnn }
+\cs_new_eq:cc { @@_apply_-rule_xW:nnn } { @@_apply_rule_xW:nnn }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -4875,7 +4918,7 @@
 %   empty.
 % \changes{v1.0r}{2021/09/06}{Macro added (gh/606)}
 %    \begin{macrocode}
-\prg_new_conditional:Npnn \@@_if_execute_immediately:n #1 { F, TF }
+\prg_new_conditional:Npnn \@@_if_execute_immediately:n #1 { T, F, TF }
   {
     \@@_if_usable:nTF {#1}
       {
@@ -5116,7 +5159,8 @@
 %
 %    \begin{macrocode}
 \msg_new:nnnn { hooks } { unknown-rule }
-  { Unknown~ relationship~ '#3'~
+  {
+    Unknown~ relationship~ '#3'~
     between~ labels~ '#2'~ and~ '#4'~
     \str_if_eq:nnF {#1} {??} { ~in~hook~'#1' }. ~
     Perhaps~ a~ misspelling?
@@ -5133,6 +5177,22 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\msg_new:nnnn { hooks } { rule-too-late }
+  {
+    Sorting~rule~for~'#1'~hook~applied~too~late.\\
+    Try~setting~this~rule~earlier.
+  }
+  {
+    You~tried~to~set~the~ordering~of~hook~'#1'~using\\
+    \ \ \iow_char:N\\DeclareHookRule{#1}{#2}{#3}{#4}\\
+    but~hook~'#1'~was~already~used~as~a~one-time~hook,~
+    thus~sorting~is\\
+    no~longer~possible.~Declare~the~rule~
+    before~the~hook~is~used.
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \msg_new:nnnn { hooks } { misused-top-level }
   {
     Illegal~use~of~\iow_char:N \\AddToHook{#1}[top-level]{...}.\\
diff --git a/base/slides.dtx b/base/slides.dtx
index 06a43262..5ea9e58d 100644
--- a/base/slides.dtx
+++ b/base/slides.dtx
@@ -53,7 +53,7 @@
 %<*driver>
        \ProvidesFile{slides.drv}
 %</driver>
-              [2021/10/04 v2.4b
+              [2022/05/18 v2.4b
 %<+class>               Standard LaTeX document class]
 %<+cmd>               SLiTeX definitions]
 %    \end{macrocode}
@@ -2348,8 +2348,9 @@ COLOR LAYER\\[.75in]%
 %  any output when the |@visible| switch is false.
 %
 % \changes{v2.2j}{1994/03/11}{Corrected \cs{@oval}, like previous
+%    change to the \LaTeX{} format.}
 % \changes{v2.4a}{2016/03/29}{Initialize in \cs{@oval}tests added for
-%    latex/4452} change to the \LaTeX{} format.}
+%    latex/4452}
 %    \begin{macrocode}
 \def\line(#1,#2)#3{\if at visible\@xarg #1\relax \@yarg #2\relax
 \@linelen #3\unitlength
diff --git a/base/testfiles-lthooks/github-0606.tlg b/base/testfiles-lthooks/github-0606.tlg
index 82f9eced..42cced6a 100644
--- a/base/testfiles-lthooks/github-0606.tlg
+++ b/base/testfiles-lthooks/github-0606.tlg
@@ -10,6 +10,15 @@ l. ...\NewHook{A}
 There already exists a hook declaration with this name.
 Please use a different name for your hook.
 B
+! LaTeX hooks Error: Sorting rule for 'A' hook applied too late.
+(hooks)              Try setting this rule earlier.
+For immediate help type H <return>.
+ ...                                              
+l. ...\DeclareHookRule{A}{b}{after}{c}
+You tried to set the ordering of hook 'A' using
+  \DeclareHookRule{A}{b}{after}{c}
+but hook 'A' was already used as a one-time hook, thus sorting is
+no longer possible. Declare the rule before the hook is used.
 -> The hook 'A':
 > Code chunks:
 >     ---
diff --git a/base/testfiles-lthooks/github-0818.lvt b/base/testfiles-lthooks/github-0818.lvt
new file mode 100644
index 00000000..f4ade953
--- /dev/null
+++ b/base/testfiles-lthooks/github-0818.lvt
@@ -0,0 +1,25 @@
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\input{regression-test}
+
+\START
+
+\ExplSyntaxOn
+\makeatletter
+
+\hook_new:n {aaaa}
+\hook_gput_code:nnn {aaaa} {A} { }
+\hook_gput_code:nnn {aaaa} {B}
+  { \hook_gset_rule:nnnn {aaaa} {A} {before} {B} }
+
+\tex_everypar:D { \typeout{ERROR} }
+
+\__hook_initialize_all:
+
+\hook_use_once:n {aaaa}
+
+\END
diff --git a/base/testfiles-lthooks/github-0818.tlg b/base/testfiles-lthooks/github-0818.tlg
new file mode 100644
index 00000000..8cd8102e
--- /dev/null
+++ b/base/testfiles-lthooks/github-0818.tlg
@@ -0,0 +1,11 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+! LaTeX hooks Error: Sorting rule for 'aaaa' hook applied too late.
+(hooks)              Try setting this rule earlier.
+For immediate help type H <return>.
+ ...                                              
+l. ...\hook_use_once:n {aaaa}
+You tried to set the ordering of hook 'aaaa' using
+  \DeclareHookRule{aaaa}{A}{before}{B}
+but hook 'aaaa' was already used as a one-time hook, thus sorting is
+no longer possible. Declare the rule before the hook is used.
diff --git a/base/testfiles-lthooks/lthooks-031.lvt b/base/testfiles-lthooks/lthooks-031.lvt
new file mode 100644
index 00000000..d5ec14be
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-031.lvt
@@ -0,0 +1,40 @@
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\documentclass{article}
+
+\input{regression-test}
+
+\START
+
+\NewHook{foo}
+
+\AddToHook{include/foo/after}[A]{\typeout{A1}}
+\AddToHook{include/foo/after}[B]{\typeout{B1}}
+\AddToHook{begindocument}[A]{\typeout{A2}}
+\AddToHook{begindocument}[B]{\typeout{B2}}
+
+\ShowHook{include/foo/after}
+\ShowHook{begindocument}
+
+\AddToHook{begindocument}[X]{\DeclareHookRule{include/foo/after}{B}{before}{A}}
+\AddToHook{begindocument}[Y]{\DeclareHookRule{begindocument}{B}{before}{A}}
+
+\begin{document}
+
+\ShowHook{include/foo/after}
+\ShowHook{begindocument}
+
+Test
+
+\include{foo}
+
+\ShowHook{include/foo/after}
+
+\AddToHook{include/foo/after}[C]{\typeout{C1}}
+
+
+\END
diff --git a/base/testfiles-lthooks/filehook-003.tlg b/base/testfiles-lthooks/lthooks-031.tlg
similarity index 52%
copy from base/testfiles-lthooks/filehook-003.tlg
copy to base/testfiles-lthooks/lthooks-031.tlg
index a64b8732..2e2f54c7 100644
--- a/base/testfiles-lthooks/filehook-003.tlg
+++ b/base/testfiles-lthooks/lthooks-031.tlg
@@ -1,23 +1,34 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-(article.cls
-Document Class: article ....-..-.. v... Standard LaTeX document class
-(size10.clo
-File: size10.clo ....-..-.. v... Standard LaTeX file (size option)
-)
-\c at part=\count...
-\c at section=\count...
-\c at subsection=\count...
-\c at subsubsection=\count...
-\c at paragraph=\count...
-\c at subparagraph=\count...
-\c at figure=\count...
-\c at table=\count...
-\abovecaptionskip=\skip...
-\belowcaptionskip=\skip...
-\bibindent=\dimen...
-)
-No file filehook-003.aux.
+-> The generic hook 'include/foo/after':
+> Code chunks:
+>     A -> \typeout {A1}
+>     B -> \typeout {B1}
+> Document-level (top-level) code (executed first):
+>     ---
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order (after reversal):
+>     B, A.
+<recently read> }
+l. ...\ShowHook{include/foo/after}
+-> The hook 'begindocument':
+> Code chunks:
+>     A -> \typeout {A2}
+>     B -> \typeout {B2}
+> Document-level (top-level) code (executed last):
+>     ---
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order:
+>     A, B.
+<recently read> }
+l. ...\ShowHook{begindocument}
+No file lthooks-031.aux.
 LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line ....
 LaTeX Font Info:    ... okay on input line ....
 LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line ....
@@ -32,42 +43,42 @@ LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line ....
 LaTeX Font Info:    ... okay on input line ....
 LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line ....
 LaTeX Font Info:    ... okay on input line ....
--> The hook 'include/before':
-> Code chunks:
->     A -> \typeout {A}
->     B -> \typeout {B}
->     C -> \typeout {C}
-> Document-level (top-level) code (executed last):
->     ---
-> Extra code for next invocation:
->     ---
-> Rules:
->     ---
-> Execution order:
->     A, B, C.
--> The hook 'include/after':
+A2
+B2
+! LaTeX hooks Error: Sorting rule for 'begindocument' hook applied too late.
+(hooks)              Try setting this rule earlier.
+For immediate help type H <return>.
+ ...                                              
+l. ...\begin{document}
+You tried to set the ordering of hook 'begindocument' using
+  \DeclareHookRule{begindocument}{B}{before}{A}
+but hook 'begindocument' was already used as a one-time hook, thus sorting is
+no longer possible. Declare the rule before the hook is used.
+-> The generic hook 'include/foo/after':
 > Code chunks:
->     A -> \typeout {A}
->     B -> \typeout {B}
->     C -> \typeout {C}
+>     A -> \typeout {A1}
+>     B -> \typeout {B1}
 > Document-level (top-level) code (executed first):
 >     ---
 > Extra code for next invocation:
 >     ---
 > Rules:
->     ---
-> Execution order (after reversal):
->     C, B, A.
--> The hook 'include/end':
-> Code chunks:
->     A -> \typeout {A}
->     B -> \typeout {B}
->     C -> \typeout {C}
-> Document-level (top-level) code (executed first):
->     ---
-> Extra code for next invocation:
->     ---
-> Rules:
->     ---
-> Execution order (after reversal):
->     C, B, A.
+>     B|A with relation <
+> Execution order (after reversal and applying rules):
+>     B, A.
+<recently read> }
+l. ...\ShowHook{include/foo/after}
+-> The hook 'begindocument':
+> The hook is empty.
+<recently read> }
+l. ...\ShowHook{begindocument}
+[1
+]
+No file foo.tex.
+B1
+A1
+-> The generic hook 'include/foo/after':
+> The hook is empty.
+<recently read> }
+l. ...\ShowHook{include/foo/after}
+C1
diff --git a/base/testfiles/github-0479-often.luatex.tlg b/base/testfiles/github-0479-often.luatex.tlg
index d01ec530..20f0b469 100644
--- a/base/testfiles/github-0479-often.luatex.tlg
+++ b/base/testfiles/github-0479-often.luatex.tlg
@@ -130,6 +130,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/github-0479-often.tlg b/base/testfiles/github-0479-often.tlg
index 047f4079..0ee320e2 100644
--- a/base/testfiles/github-0479-often.tlg
+++ b/base/testfiles/github-0479-often.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/github-0479-often.xetex.tlg b/base/testfiles/github-0479-often.xetex.tlg
index c6cd70f6..473b90c0 100644
--- a/base/testfiles/github-0479-often.xetex.tlg
+++ b/base/testfiles/github-0479-often.xetex.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
index a8445f98..003c3d8b 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
@@ -112,6 +112,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
@@ -726,6 +728,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
index 55f0c82c..68f358e2 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
@@ -106,6 +106,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
@@ -710,6 +712,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
index 68b741e2..be49a267 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
@@ -106,6 +106,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
@@ -719,6 +721,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.luatex.tlg
index 53337720..f1e098d5 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.luatex.tlg
@@ -130,6 +130,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg
index da7430cf..e9eee07e 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.xetex.tlg
index cbe8d056..ad3661a8 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.xetex.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.luatex.tlg
index be300fe6..786bb5c7 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.luatex.tlg
@@ -131,6 +131,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg
index 51bdbe78..ff6b2639 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.xetex.tlg
index 7900e8fc..0a887fbc 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.xetex.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.luatex.tlg
index ab2ce841..91e8100d 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.luatex.tlg
@@ -131,6 +131,8 @@ Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg
index 9222f620..c72089a4 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg
@@ -120,6 +120,8 @@ Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.xetex.tlg
index 13208f99..18c97772 100644
--- a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.xetex.tlg
@@ -120,6 +120,8 @@ Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Already applied: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.luatex.tlg b/base/testfiles/tlb-rollback-004-often.luatex.tlg
index 1286be7c..50751557 100644
--- a/base/testfiles/tlb-rollback-004-often.luatex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.luatex.tlg
@@ -131,6 +131,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.tlg b/base/testfiles/tlb-rollback-004-often.tlg
index ccbce686..2409d5cf 100644
--- a/base/testfiles/tlb-rollback-004-often.tlg
+++ b/base/testfiles/tlb-rollback-004-often.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.xetex.tlg b/base/testfiles/tlb-rollback-004-often.xetex.tlg
index 4261b948..91713ffb 100644
--- a/base/testfiles/tlb-rollback-004-often.xetex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.xetex.tlg
@@ -120,6 +120,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-rollback-005.luatex.tlg b/base/testfiles/tlb-rollback-005.luatex.tlg
index da304646..9af328fb 100644
--- a/base/testfiles/tlb-rollback-005.luatex.tlg
+++ b/base/testfiles/tlb-rollback-005.luatex.tlg
@@ -134,6 +134,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-rollback-005.tlg b/base/testfiles/tlb-rollback-005.tlg
index d1b48e5c..e7fd78e7 100644
--- a/base/testfiles/tlb-rollback-005.tlg
+++ b/base/testfiles/tlb-rollback-005.tlg
@@ -124,6 +124,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/testfiles/tlb-rollback-005.xetex.tlg b/base/testfiles/tlb-rollback-005.xetex.tlg
index 66a291e1..aa620651 100644
--- a/base/testfiles/tlb-rollback-005.xetex.tlg
+++ b/base/testfiles/tlb-rollback-005.xetex.tlg
@@ -124,6 +124,8 @@ Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
+Skipping: [....-..-..] Refuse setting rule for one-time hooks on input line ....
+Applying: [....-..-..] Refuse setting rule for one-time hooks on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
 Applying: [....-..-..] Standardise generic hook names on input line ....
 Skipping: [....-..-..] Standardise generic hook names on input line ....
diff --git a/base/update-lthooks-tests.sh b/base/update-lthooks-tests.sh
index 493f2fcb..3b49584d 100755
--- a/base/update-lthooks-tests.sh
+++ b/base/update-lthooks-tests.sh
@@ -85,6 +85,8 @@ l3build save -cconfig-lthooks \
    lthooks-029 \
    lthooks-029-deprecated \
    lthooks-030 \
+   lthooks-031 \
+   lthooks-032 \
    lthooks-errors \
    lthooks-errors-deprecated \
    lthooks-etoolbox \
@@ -101,7 +103,8 @@ l3build save -cconfig-lthooks \
    github-0565 \
    github-0606 \
    github-0648 \
-   github-0648b 
+   github-0648b \
+   github-0818
 
 
 





More information about the latex3-commits mailing list.