[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks2: fixed typo in csnames moved some more code (c5784f12)
Frank Mittelbach
frank.mittelbach at latex-project.org
Wed Aug 19 12:14:21 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : lthooks2
Link : https://github.com/latex3/latex2e/commit/c5784f12f27fbf28f3aacf1d136d3abd2ba2b0b1
>---------------------------------------------------------------
commit c5784f12f27fbf28f3aacf1d136d3abd2ba2b0b1
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Wed Aug 19 12:14:21 2020 +0200
fixed typo in csnames
moved some more code
>---------------------------------------------------------------
c5784f12f27fbf28f3aacf1d136d3abd2ba2b0b1
base/ltfiles.dtx | 36 ++++++++++++++++++++++++++++++++++--
base/lthooks.dtx | 39 ---------------------------------------
base/ltshipout.dtx | 16 ++++++++--------
3 files changed, 42 insertions(+), 49 deletions(-)
diff --git a/base/ltfiles.dtx b/base/ltfiles.dtx
index da15ce94..a07cb7e2 100644
--- a/base/ltfiles.dtx
+++ b/base/ltfiles.dtx
@@ -352,8 +352,6 @@
% \changes{v1.1e}{1996/04/24}
% {(DPC) Reset \cs{AtBeginDocument} eg for latex/1297}
% \begin{macrocode}
-% \let\AtBeginDocument\@firstofone
-% \@begindocumenthook
\UseOneTimeHook{begindocument}%
\@kernel at after@begindocument
% \end{macrocode}
@@ -426,6 +424,40 @@
\NewHook{begindocument/before}
\NewHook{begindocument/end}
% \end{macrocode}
+
+
+
+% \begin{macro}{\@kernel at after@begindocument at before,\@kernel at after@begindocument}
+%
+% Above we used two kernel only hooks to be run after the public
+% \hook{begindocument/before} and after \hook{begindocument}
+% hooks.
+%
+% In \cs{@kernel at after@begindocument at before} we already place one
+% action: drop the fast execution code for the
+% \hook{env/document/begin} hook. That hook marks the end of the
+% preamble and should therefore only be run once. In a normal
+% document that is anyway the case (so the code would just sit
+% there taking up space afterwards, which these days is rather
+% harmless), however, in more complicated scenarios where several
+% full documents are combined to a single document it might get
+% applied several times with harmful effects. We therefore
+% explicitly drop it at this point. the coing is somewhat obscure
+% due to the name of the macro which requires constructing.
+% \begin{macrocode}
+\edef \@kernel at after@begindocument at before {%
+ \let\expandafter\noexpand\csname
+ g__hook_env/document/begin_code_tl\endcsname
+ \noexpand\@empty}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let \@kernel at after@begindocument \@empty
+% \end{macrocode}
+%
+% \end{macro}
+%
+
%
% \begin{macrocode}
%</2ekernel|latexrelease>
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 465f25d7..d67de790 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -3678,22 +3678,6 @@
% \end{macro}
%
%
-% \section{Generic hooks for environments}
-%
-%
-%
-%
-%
-%
-%
-%
-% \section{Generic hooks for file loads}
-%
-%
-%
-%
-%
-%
%
% \section{Hooks in \cs{begin} document}
%
@@ -3706,29 +3690,6 @@
% \end{macrocode}
%
%
-% \begin{macro}{\document}
-%
-% \begin{macrocode}
-% \end{macrocode}
-%
-% \end{macro}
-%
-%
-% \begin{macro}{\@kernel at after@begindocument at before,\@kernel at after@begindocument}
-%
-% \fmi{the name is wrong --- fix}
-% \begin{macrocode}
-\edef \@kernel at after@begindocument at before{%
- \let\expandafter\noexpand\csname
- g__hook_env/document/begin_code_tl\endcsname
- \noexpand\@empty}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\let\@kernel at after@begindocument\@empty
-% \end{macrocode}
-%
-% \end{macro}
%
%
%
diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index bf7904e5..6c173f93 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -1317,10 +1317,10 @@
% \section{Internal commands needed elsewhere}
%
% \begin{macro}{\@expl@@shipout at add@firstpage at material@Nn,
-% \@shipout at add@background at box@n,
-% \@shipout at add@foreground at box@n,
-% \@shipout at add@background at picture@n,
-% \@shipout at add@foreground at picture@n}
+% \@expl@@shipout at add@background at box@n,
+% \@expl@@shipout at add@foreground at box@n,
+% \@expl@@shipout at add@background at picture@n,
+% \@expl@@shipout at add@foreground at picture@n}
% Some internals needed elsewhere.
% \begin{macrocode}
%<@@=>
@@ -1332,22 +1332,22 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_set_eq:NN \@shipout at add@background at box@n
+\cs_set_eq:NN \@expl@@shipout at add@background at box@n
\__shipout_add_background_box:n
% \end{macrocode}
%
% \begin{macrocode}
-\cs_set_eq:NN \@shipout at add@foreground at box@n
+\cs_set_eq:NN \@expl@@shipout at add@foreground at box@n
\__shipout_add_foreground_box:n
% \end{macrocode}
%
% \begin{macrocode}
-\cs_set_eq:NN \@shipout at add@background at picture@n
+\cs_set_eq:NN \@expl@@shipout at add@background at picture@n
\__shipout_add_background_picture:n
% \end{macrocode}
%
% \begin{macrocode}
-\cs_set_eq:NN \@shipout at add@foreground at picture@n
+\cs_set_eq:NN \@expl@@shipout at add@foreground at picture@n
\__shipout_add_foreground_picture:n
% \end{macrocode}
% \end{macro}
More information about the latex3-commits
mailing list.