[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks2: fix to tmp lthooks.sty more tests (ab530b94)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Aug 14 23:11:07 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : lthooks2
Link       : https://github.com/latex3/latex2e/commit/ab530b949fd25aad4533cc910ea4f43f90264e6a

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

commit ab530b949fd25aad4533cc910ea4f43f90264e6a
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Aug 14 23:11:07 2020 +0200

    fix to tmp lthooks.sty
    more tests


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

ab530b949fd25aad4533cc910ea4f43f90264e6a
 base/lthooks.dtx                                   |   8 +-
 base/testfiles-lthooks/filehook-007.lvt            |  16 ++
 base/testfiles-lthooks/filehook-007.tlg            |   6 +
 base/testfiles-lthooks/filehook-008.lvt            | 118 +++++++++++++
 base/testfiles-lthooks/filehook-008.tlg            | 193 +++++++++++++++++++++
 base/testfiles-lthooks/filehook-009.lvt            |  34 ++++
 base/testfiles-lthooks/filehook-009.tlg            |  16 ++
 base/testfiles-lthooks/filehook-bug-140.lvt        |  35 ++++
 .../filehook-bug-140.tlg}                          |   0
 base/testfiles-lthooks/lthooks-025.lvt             |  45 +++++
 base/testfiles-lthooks/lthooks-025.tlg             |  14 ++
 base/testfiles-lthooks/lthooks-errors.lvt          |  36 ++++
 base/testfiles-lthooks/lthooks-errors.tlg          |  51 ++++++
 base/testfiles-lthooks/lthooks-etoolbox.lvt        |  30 ++++
 .../lthooks-etoolbox.tlg}                          |   0
 15 files changed, 597 insertions(+), 5 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index e53928f4..ad496ccb 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -4000,11 +4000,8 @@
 %    \begin{macrocode}
 %<*package>
 %    \end{macrocode}
-
-
-
+%
 %    \begin{macrocode}
-\RequirePackage{xparse}
 \ProvidesExplPackage{lthooks}{\lthooksdate}{\lthooksversion}
                     {Hook management interface for LaTeX2e}
 %    \end{macrocode}
@@ -4017,7 +4014,8 @@
 %    \begin{macrocode}
 \@ifl at t@r\fmtversion{2020/10/01}
                     {}
-                    {\input{lthooks.ltx}
+                    {\RequirePackage{xparse}
+                     \input{lthooks.ltx}
                      \input{ltshipout.ltx}
                      \input{ltfilehook.ltx}
                     }
diff --git a/base/testfiles-lthooks/filehook-007.lvt b/base/testfiles-lthooks/filehook-007.lvt
new file mode 100644
index 00000000..6fe7f7b0
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-007.lvt
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\input{regression-test}
+\START
+\makeatletter
+\gdef\@missingfileerror#1#2{%
+     \typeout{^^J! LaTeX Error: File `#1.#2' not found.^^J^^J%
+      Type X to quit or <RETURN> to proceed,^^J%
+      or enter new name. (Default extension: #2)^^J}%
+     \message{Enter file name: }%
+     \let\@missingfile at area\@empty
+     \let\@missingfile at base\@empty
+     \def\@missingfile at ext{tex}}
+\makeatother
+\usepackage{package-doesnt-exist}
+\END
diff --git a/base/testfiles-lthooks/filehook-007.tlg b/base/testfiles-lthooks/filehook-007.tlg
new file mode 100644
index 00000000..b2b4e4f6
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-007.tlg
@@ -0,0 +1,6 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+! LaTeX Error: File `package-doesnt-exist.sty' not found.
+Type X to quit or <RETURN> to proceed,
+or enter new name. (Default extension: sty)
+Enter file name: 
diff --git a/base/testfiles-lthooks/filehook-008.lvt b/base/testfiles-lthooks/filehook-008.lvt
new file mode 100644
index 00000000..32692231
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-008.lvt
@@ -0,0 +1,118 @@
+\documentclass{article}
+
+\ExplSyntaxOn
+\iow_new:N \l_tmpa_iow
+\int_step_inline:nn {10}
+  {
+    \iow_open:Nn \l_tmpa_iow { \int_to_alph:n {#1}.tex }
+    \iow_now:Nx \l_tmpa_iow
+      { \exp_not:N \typeout { >>~\int_to_Alph:n {#1}~<< } }
+    \iow_close:N \l_tmpa_iow
+  }
+\ExplSyntaxOff
+
+\input{regression-test}
+\START
+\makeatletter
+
+% A package
+\declare at file@substitution{wrong.sty}{trace.sty}
+\usepackage{wrong}
+
+\def\undoone#1{%
+  \ifx\relax#1\else
+    \undeclare at file@substitution{#1}%
+    \expandafter\undoone
+  \fi}
+\def\undoall{\undoone abcdefghij\relax}
+
+
+% A loop
+\declare at file@substitution{e}{h}
+\declare at file@substitution{h}{i}
+\declare at file@substitution{i}{a}
+\declare at file@substitution{a}{b}
+\declare at file@substitution{b}{g}
+\declare at file@substitution{g}{i}
+
+\set at curr@file{e}%
+\show\@curr at file
+\input{e}
+
+\undoall
+
+% A row of substitutions (no loop)
+\declare at file@substitution{a}{b}
+\declare at file@substitution{b}{c}
+\declare at file@substitution{c}{d}
+\declare at file@substitution{d}{e}
+\declare at file@substitution{e}{f}
+\declare at file@substitution{f}{g}
+\declare at file@substitution{g}{h}
+\declare at file@substitution{h}{i}
+\declare at file@substitution{i}{j}
+
+\set at curr@file{a}%
+\show\@curr at file
+\input{a}
+
+\undoall
+
+
+% A loop at the beginning
+\declare at file@substitution{a}{a}
+
+\set at curr@file{a}%
+\show\@curr at file
+\input{a}
+
+\undoall
+
+
+% A loop at the beginning
+\declare at file@substitution{a}{b}
+\declare at file@substitution{b}{a}
+
+\set at curr@file{a}%
+\show\@curr at file
+\input{a}
+
+\undoall
+
+
+% A loop at the last item
+\declare at file@substitution{a}{b}
+\declare at file@substitution{b}{c}
+\declare at file@substitution{c}{d}
+\declare at file@substitution{d}{e}
+\declare at file@substitution{e}{f}
+\declare at file@substitution{f}{g}
+\declare at file@substitution{g}{h}
+\declare at file@substitution{h}{i}
+\declare at file@substitution{i}{i}
+
+\set at curr@file{a}%
+\show\@curr at file
+\input{a}
+
+\undoall
+
+
+\declare at file@substitution{zzzz}{test}
+\declare at file@substitution{test}{blub}
+\declare at file@substitution{blub}{}
+\declare at file@substitution{}{no sympathy}
+\expandafter\show\csname @file-subst at zzzz\endcsname
+
+\set at curr@file{zzzz}
+\show\@curr at file
+
+\input{zzzz}
+
+\input{}
+
+\input{ }
+
+\input{ zzzz }
+
+\END
diff --git a/base/testfiles-lthooks/filehook-008.tlg b/base/testfiles-lthooks/filehook-008.tlg
new file mode 100644
index 00000000..b0e89fdc
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-008.tlg
@@ -0,0 +1,193 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+(trace.sty
+LaTeX Warning: You have requested package `wrong',
+               but the package provides `trace'.
+Package: trace ....-..-.. v... trace LaTeX code
+)
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! g.tex replaced by i.tex...
+l. ...\set at curr@file{e}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! i.tex replaced by a.tex...
+l. ...\set at curr@file{e}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! a.tex replaced by b.tex...
+l. ...\set at curr@file{e}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! b.tex replaced by g.tex...
+l. ...\set at curr@file{e}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \@curr at file=macro:
+->.tex.
+l. ...\show\@curr at file
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! g.tex replaced by i.tex...
+l. ...\input{e}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! i.tex replaced by a.tex...
+l. ...\input{e}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! a.tex replaced by b.tex...
+l. ...\input{e}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! b.tex replaced by g.tex...
+l. ...\input{e}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+(.tex File ignored)
+> \@curr at file=macro:
+->j.tex.
+l. ...\show\@curr at file
+(j.tex
+>> J <<
+)
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! a.tex replaced by a.tex...
+l. ...\set at curr@file{a}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \@curr at file=macro:
+->.tex.
+l. ...\show\@curr at file
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! a.tex replaced by a.tex...
+l. ...\input{a}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+(.tex File ignored)
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! b.tex replaced by a.tex...
+l. ...\set at curr@file{a}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! a.tex replaced by b.tex...
+l. ...\set at curr@file{a}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \@curr at file=macro:
+->.tex.
+l. ...\show\@curr at file
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! b.tex replaced by a.tex...
+l. ...\input{a}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! a.tex replaced by b.tex...
+l. ...\input{a}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+(.tex File ignored)
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! i.tex replaced by i.tex...
+l. ...\set at curr@file{a}
+                      %
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \@curr at file=macro:
+->.tex.
+l. ...\show\@curr at file
+! Undefined control sequence.
+<argument> LaTeX3 error: 
+                          File loop! i.tex replaced by i.tex...
+l. ...\input{a}
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+(.tex File ignored)
+> \@file-subst at zzzz=\long macro:
+->test.tex.
+<recently read> \@file-subst at zzzz 
+l. ......er\show\csname @file-subst at zzzz\endcsname
+> \@curr at file=macro:
+->no sympathy.tex.
+l. ...\show\@curr at file
+(no sympathy.tex
+no sympathy.tex
+) (.tex File ignored) (.tex File ignored) (no sympathy.tex
+no sympathy.tex
+)
diff --git a/base/testfiles-lthooks/filehook-009.lvt b/base/testfiles-lthooks/filehook-009.lvt
new file mode 100644
index 00000000..be0705d2
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-009.lvt
@@ -0,0 +1,34 @@
+\documentclass[12pt,unknown,opt]{article}
+
+\begin{filecontents}[overwrite]{load-structuredlog.sty}
+\usepackage{structuredlog}
+\end{filecontents}
+
+\begin{filecontents}[overwrite]{broken-pkg.sty}
+\typeout{I'M BROKEN}
+\def\blub{opt unused}
+\DeclareOption{opt}{\def\blub{opt used}}
+\ProcessOptions
+\typeout{Option: \blub}
+\usepackage{load-structuredlog}
+\end{filecontents}
+
+\begin{filecontents}[overwrite]{broken-pkg-fixed.sty}
+\@@input broken-pkg.sty
+\typeout{I AM \CurrentFileUsed}
+\typeout{I FIX \CurrentFile}
+\end{filecontents}
+
+\makeatletter
+\declare at file@substitution{broken-pkg.sty}{broken-pkg-fixed.sty}
+\makeatother
+
+\AddToHook{file/before/broken-pkg.sty}{\typeout{Patch BEFORE broken}}
+\AddToHook{file/after/broken-pkg.sty}{\typeout{Patch AFTER broken}}
+
+\input{regression-test}
+\START
+
+\usepackage{broken-pkg}
+
+\END
diff --git a/base/testfiles-lthooks/filehook-009.tlg b/base/testfiles-lthooks/filehook-009.tlg
new file mode 100644
index 00000000..64e7e3f6
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-009.tlg
@@ -0,0 +1,16 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+Patch BEFORE broken
+(broken-pkg-fixed.sty (broken-pkg.sty
+I'M BROKEN
+Option: opt used
+) (load-structuredlog.sty) (structuredlog.sty
+Package: structuredlog ....-..-.. vv... Structuring the TeX transcript file
+\g__filehook_nesting_level_int=\count...
+)
+== (LEVEL 2 STOP) load-structuredlog.sty
+I AM broken-pkg-fixed.sty
+I FIX broken-pkg.sty
+)
+Patch AFTER broken
+= (LEVEL 1 STOP) broken-pkg-fixed.sty (broken-pkg.sty requested)
diff --git a/base/testfiles-lthooks/filehook-bug-140.lvt b/base/testfiles-lthooks/filehook-bug-140.lvt
new file mode 100644
index 00000000..179236eb
--- /dev/null
+++ b/base/testfiles-lthooks/filehook-bug-140.lvt
@@ -0,0 +1,35 @@
+\documentclass{article}
+
+\input{regression-test}
+
+\def\foo{foo}
+\def\foobar{foo-bar}
+
+\begin{filecontents}{\jobname-foo-bar}
+\typeout{file: \jobname-foo-bar  = \CurrentFile}
+\end{filecontents}
+
+\AddToHook{file/before/\jobname-foo-bar.tex}{\typeout{1}}
+\AddToHook{file/after/\jobname-foo-bar.tex}{\typeout{1}}
+
+\AddToHook{file/before/\jobname-\foo-bar.tex}{\typeout{2}}
+\AddToHook{file/after/\jobname-\foo-bar.tex}{\typeout{2}}
+
+\AddToHook{file/before/\jobname-\foobar.tex}{\typeout{3}}
+\AddToHook{file/after/\jobname-\foobar.tex}{\typeout{3}}
+
+\ShowHook{file/before/\jobname-foo-bar.tex}
+
+\typeout{----------------------}
+
+\input{\jobname-foo-bar}
+
+\typeout{----------------------}
+
+\input{\jobname-\foo-bar}
+
+\typeout{----------------------}
+
+\input{\jobname-\foobar}
+
+\END
diff --git a/base/testfiles-TU/github-0282.tlg b/base/testfiles-lthooks/filehook-bug-140.tlg
similarity index 100%
copy from base/testfiles-TU/github-0282.tlg
copy to base/testfiles-lthooks/filehook-bug-140.tlg
diff --git a/base/testfiles-lthooks/lthooks-025.lvt b/base/testfiles-lthooks/lthooks-025.lvt
new file mode 100644
index 00000000..c2a56a1c
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-025.lvt
@@ -0,0 +1,45 @@
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\documentclass{article}
+
+\input{regression-test}
+
+\START
+
+\IfHookExistsTF{foo}{\typeout{foo exists}}{\typeout{foo does not exists}}
+\IfHookEmptyTF {foo}{\typeout{foo empty}}{\typeout{foo not empty}}
+
+\NewHook{foo}
+
+\IfHookExistsTF{foo}{\typeout{foo exists}}{\typeout{foo does not exists}}
+\IfHookEmptyTF {foo}{\typeout{foo empty}}{\typeout{foo not empty}}
+
+\AddToHook{foo}{...}
+
+\IfHookExistsTF{foo}{\typeout{foo exists}}{\typeout{foo does not exists}}
+\IfHookEmptyTF {foo}{\typeout{foo empty}}{\typeout{foo not empty}}
+
+
+\IfHookExistsTF{env/quote/before}{\typeout{env/quote/before exists}}
+                                 {\typeout{env/quote/before does not exists}}
+\IfHookEmptyTF {env/quote/before}{\typeout{env/quote/before empty}}
+                                 {\typeout{env/quote/before not empty}}
+
+\AddToHook{env/quote/before}{...}
+
+\IfHookExistsTF{env/quote/before}{\typeout{env/quote/before exists}}
+                                 {\typeout{env/quote/before does not exists}}
+\IfHookEmptyTF {env/quote/before}{\typeout{env/quote/before empty}}
+                                 {\typeout{env/quote/before not empty}}
+
+\RemoveFromHook{env/quote/before}[*]
+
+\IfHookExistsTF{env/quote/before}{\typeout{env/quote/before exists}}
+                                 {\typeout{env/quote/before does not exists}}
+\IfHookEmptyTF {env/quote/before}{\typeout{env/quote/before empty}}
+                                 {\typeout{env/quote/before not empty}}
+
+\END
diff --git a/base/testfiles-lthooks/lthooks-025.tlg b/base/testfiles-lthooks/lthooks-025.tlg
new file mode 100644
index 00000000..2c826a4a
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-025.tlg
@@ -0,0 +1,14 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+foo does not exists
+foo empty
+foo exists
+foo empty
+foo exists
+foo not empty
+env/quote/before does not exists
+env/quote/before empty
+env/quote/before exists
+env/quote/before not empty
+env/quote/before exists
+env/quote/before empty
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors.lvt
new file mode 100644
index 00000000..68523490
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-errors.lvt
@@ -0,0 +1,36 @@
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\documentclass{article}
+
+\input{regression-test}
+
+\START
+
+\NewHook{xxx}
+
+\AddToHook{xxx}[label1]{ foo1}
+\AddToHook{xxx}[label2]{ foo2}
+\AddToHook{xxx}[label3]{ foo2}
+\AddToHook{xxx}[label4]{ foo3}
+\AddToHook{xxx}[label5]{ foo5}
+
+
+\DeclareHookRule {xxx} {label1} {unknown} {label2}
+
+\DeclareHookRule {xxx} {label3} {incompatible-warning} {label4}
+
+\DeclareHookRule {xxx} {label1} {incompatible-error} {label5}
+
+\ShowHook{xxx}
+
+\makeatletter
+\@filehook at file@pop
+
+\ExplSyntaxOn
+\__hook_curr_name_pop:
+
+\END
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
new file mode 100644
index 00000000..c4fa1748
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -0,0 +1,51 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+! Package hooks Error: Unknown relationship `unknown' between labels `label1'
+(hooks)                and `label2'  in hook `xxx'. Perhaps a missspelling?
+For immediate help type H <return>.
+ ...                                              
+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'.
+Package hooks Warning: Labels `label4' and `label3' are incompatible in hook
+(hooks)                `xxx'. You may see errors later.
+! Package 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. ...\ShowHook{xxx}
+LaTeX found two incompatible labels in the same hook. This indicates an
+incompatibility between packages.
+The hook 'xxx':
+ Code chunks:
+    label1 ->  foo1
+    label2 ->  foo2
+    label3 ->  foo2
+    label4 ->  foo3
+    label5 ->  foo5
+ Extra code next invocation:
+    ---
+ Rules:
+    label4|label3 with relation xW
+    label5|label1 with relation xE
+ Execution order (after applying rules):
+    label1, label2, label3, label4, label5
+! Package hooks Error: ERROR! This should not happen. Tried to pop from an
+(hooks)                empty file name stack.
+(hooks)                Please report at https://github.com/latex3/latex2e.
+Type <return> to continue.
+ ...                                              
+l. ...\@filehook at file@pop
+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.
+! Package hooks Error: ERROR! This should not happen. Tried to pop from an
+(hooks)                empty default label stack.
+(hooks)                Please report at https://github.com/latex3/latex2e.
+Type <return> to continue.
+ ...                                              
+l. ...\__hook_curr_name_pop:
+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.
diff --git a/base/testfiles-lthooks/lthooks-etoolbox.lvt b/base/testfiles-lthooks/lthooks-etoolbox.lvt
new file mode 100644
index 00000000..8b0c7da8
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-etoolbox.lvt
@@ -0,0 +1,30 @@
+
+\documentclass{article}
+
+\input{regression-test}
+
+
+\AddToHook{package/after/etoolbox}{\renewrobustcmd*{\AtEndPreamble}{\AddToHook{begindocument/before}}}
+
+
+\usepackage{etoolbox}
+
+
+
+\def\test#1{%
+  #1{\typeout{>>\string#1}%
+     #1{\typeout{>>>>\string#1 \space (nested)}}}}
+
+\START
+
+\test\AtEndPreamble % env/document/begin
+\test\AfterEndPreamble % begindocument/end % Correct
+\test\AtEndDocument % enddocument
+\test\AfterEndDocument % enddocument/end
+
+
+\begin{document}
+
+Test
+
+\end{document}
diff --git a/base/testfiles-TU/github-0282.tlg b/base/testfiles-lthooks/lthooks-etoolbox.tlg
similarity index 100%
copy from base/testfiles-TU/github-0282.tlg
copy to base/testfiles-lthooks/lthooks-etoolbox.tlg





More information about the latex3-commits mailing list.