[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks2: fix for acc156 (90061bfe)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Aug 21 19:34:57 CEST 2020


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

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

commit 90061bfed82a9dd299a397868203e3aeb83eae56
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Aug 21 19:34:57 2020 +0200

    fix for acc156


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

90061bfed82a9dd299a397868203e3aeb83eae56
 base/ltshipout.dtx                                  | 14 ++++++++++++++
 .../shipout2-007.lvt}                               | 21 ++++++++++++++++-----
 base/testfiles-lthooks2/shipout2-007.tlg            | 15 +++++++++++++++
 ...ipout-emulations.lvt => shipout2-emulations.lvt} |  0
 ...ipout-emulations.tlg => shipout2-emulations.tlg} |  4 ++--
 5 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index 15a69e9e..fd472fed 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -612,8 +612,10 @@
 %    Otherwise we assume that we will ship something and prepare for
 %    final adjustments (in particular setting the state of
 %    \cs{protect} while we are running the hook code).
+%    We also save the current \cs{protect} state to restore it later.
 %    \begin{macrocode}
       \bool_gset_false:N \g_@@_discard_bool
+      \cs_set_eq:NN \@@_saved_protect: \protect
       \set at typeset@protect
 %    \end{macrocode}
 %    We also store the current shipout box dimension in registers, so that
@@ -736,12 +738,24 @@
               \tex_shipout:D \box_use:N \l_shipout_box
             }
         }
+%    \end{macrocode}
+%    Restore the value of \cs{protect} in case \cs{shipout} is called
+%    outside of the output routine (where it is automatically restored
+%    because of the implicit group).
+%    \begin{macrocode}
+      \cs_set_eq:NN \protect \@@_saved_protect:
     }
 }
 %    \end{macrocode}
 %  \end{macro}
 %
 %
+%  \begin{macro}{\@@_saved_protect:}
+%    Remeber the current \cs{protect} state.
+%    \begin{macrocode}
+\cs_new_eq:NN  \@@_saved_protect: \protect
+%    \end{macrocode}
+%  \end{macro}
 %
 %  \begin{macro}{shipout/before,
 %                   shipout/foreground,shipout/background,
diff --git a/base/testfiles-lthooks/lthooks-000.lvt b/base/testfiles-lthooks2/shipout2-007.lvt
similarity index 54%
copy from base/testfiles-lthooks/lthooks-000.lvt
copy to base/testfiles-lthooks2/shipout2-007.lvt
index d4fb95d9..6a4fb243 100644
--- a/base/testfiles-lthooks/lthooks-000.lvt
+++ b/base/testfiles-lthooks2/shipout2-007.lvt
@@ -3,15 +3,26 @@
 
 \input{regression-test}
 
-\RequirePackage[enable-debug,check-declarations]{expl3}
+\DebugShipoutsOn
+
+\begin{document}
 
 \START
 
-\DebugHooksOn
-\DebugShipoutsOn
+\show\protect
 
-\begin{document}
+\shipout\null
+
+blub
 
-Test
+\show\protect
+
+\shipout\vbox{}
+
+\show\protect
 
 \end{document}
+
+\show\x
+
+
diff --git a/base/testfiles-lthooks2/shipout2-007.tlg b/base/testfiles-lthooks2/shipout2-007.tlg
new file mode 100644
index 00000000..46e34967
--- /dev/null
+++ b/base/testfiles-lthooks2/shipout2-007.tlg
@@ -0,0 +1,15 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \protect=\relax.
+l. ...\show\protect
+Absolute page = 1 (target: 3)
+[1]
+> \protect=\relax.
+l. ...\show\protect
+Absolute page = 2 (target: 3)
+[1]
+> \protect=\relax.
+l. ...\show\protect
+Absolute page = 3 (target: 3)
+[1
+] (shipout2-007.aux)
diff --git a/base/testfiles-lthooks2/shipout-emulations.lvt b/base/testfiles-lthooks2/shipout2-emulations.lvt
similarity index 100%
rename from base/testfiles-lthooks2/shipout-emulations.lvt
rename to base/testfiles-lthooks2/shipout2-emulations.lvt
diff --git a/base/testfiles-lthooks2/shipout-emulations.tlg b/base/testfiles-lthooks2/shipout2-emulations.tlg
similarity index 96%
rename from base/testfiles-lthooks2/shipout-emulations.tlg
rename to base/testfiles-lthooks2/shipout2-emulations.tlg
index fe7a54c4..d8173f08 100644
--- a/base/testfiles-lthooks2/shipout-emulations.tlg
+++ b/base/testfiles-lthooks2/shipout2-emulations.tlg
@@ -10,7 +10,7 @@ Package atenddvi Warning: Functionality of this package is already
 (atenddvi)                It is there no longer necessary to load it
 (atenddvi)                and you can safely remove it.
 (atenddvi)                Found on on input line ....
-(shipout-emulations.aux)
+(shipout2-emulations.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 ....
@@ -40,4 +40,4 @@ Shown on every page
 Absolute page = 3 (target: 3)
 Executing lastpage hook on page 3
 Does this typeout show up at the end?
-[3] (shipout-emulations.aux)
+[3] (shipout2-emulations.aux)





More information about the latex3-commits mailing list.