[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks2: atveryend and further cleanup (133a0be7)
Frank Mittelbach
frank.mittelbach at latex-project.org
Wed Aug 19 13:52:14 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : lthooks2
Link : https://github.com/latex3/latex2e/commit/133a0be76c2a9ae1acdd1ac423fc612e6b9472da
>---------------------------------------------------------------
commit 133a0be76c2a9ae1acdd1ac423fc612e6b9472da
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Wed Aug 19 13:52:14 2020 +0200
atveryend and further cleanup
>---------------------------------------------------------------
133a0be76c2a9ae1acdd1ac423fc612e6b9472da
base/build.lua | 1 -
base/doc/ltfilehook-code.tex | 5 ----
base/doc/ltfilehook-doc.tex | 5 ----
base/doc/lthooks-code.tex | 5 ----
base/doc/lthooks-doc.tex | 5 ----
base/doc/ltshipout-code.tex | 5 ----
base/doc/ltshipout-doc.tex | 5 ----
base/format.ins | 16 ++++++++++-
base/ltfilehook.dtx | 65 +++++++++++++++++++++++++++++++++++++++++++-
base/lthooks.dtx | 60 ----------------------------------------
base/ltmiscen.dtx | 2 ++
base/ltshipout.dtx | 12 ++++----
base/manifest.txt | 7 +++++
base/unpack.ins | 2 --
14 files changed, 95 insertions(+), 100 deletions(-)
diff --git a/base/build.lua b/base/build.lua
index 4276d070..ccabb9bc 100644
--- a/base/build.lua
+++ b/base/build.lua
@@ -52,7 +52,6 @@ sourcefiles =
"sample2e.tex",
"small2e.tex",
"testpage.tex",
- "filehook-ltx.sty", -- temp
"source2edoc.cls", -- temp
"*-????-??-??.sty"
}
diff --git a/base/doc/ltfilehook-code.tex b/base/doc/ltfilehook-code.tex
index 2a9c1d18..c8027032 100644
--- a/base/doc/ltfilehook-code.tex
+++ b/base/doc/ltfilehook-code.tex
@@ -1,10 +1,5 @@
% This will typeset documentation + code
%
-% However, you may first have to unpack the .sty file via
-%
-% latex ltfilehook.ins
-%
-% as it is used when processing the doumentation.
\AtBeginDocument{\AlsoImplementation}
\input{ltfilehook.dtx}
diff --git a/base/doc/ltfilehook-doc.tex b/base/doc/ltfilehook-doc.tex
index d3a20f74..220de941 100644
--- a/base/doc/ltfilehook-doc.tex
+++ b/base/doc/ltfilehook-doc.tex
@@ -1,10 +1,5 @@
% This will typeset only documentation but not the code
%
-% However, you may first have to unpack the .sty file via
-%
-% latex ltfilehook.ins
-%
-% as it is used when processing the doumentation.
\AtBeginDocument{\OnlyDescription
% \let\tableofcontents\relax
diff --git a/base/doc/lthooks-code.tex b/base/doc/lthooks-code.tex
index 32822fcf..f5fa338a 100644
--- a/base/doc/lthooks-code.tex
+++ b/base/doc/lthooks-code.tex
@@ -1,10 +1,5 @@
% This will typeset documentation + code
%
-% However, you may first have to unpack the .sty file via
-%
-% latex lthooks.ins
-%
-% as it is used when processing the doumentation.
\AtBeginDocument{\AlsoImplementation}
\input{lthooks.dtx}
diff --git a/base/doc/lthooks-doc.tex b/base/doc/lthooks-doc.tex
index 47d86a45..a51e2cd6 100644
--- a/base/doc/lthooks-doc.tex
+++ b/base/doc/lthooks-doc.tex
@@ -1,10 +1,5 @@
% This will typeset only documentation but not the code
%
-% However, you may first have to unpack the .sty file via
-%
-% latex lthooks.ins
-%
-% as it is used when processing the doumentation.
\AtBeginDocument{\OnlyDescription
% \let\tableofcontents\relax
diff --git a/base/doc/ltshipout-code.tex b/base/doc/ltshipout-code.tex
index a22dd75f..cc6a777e 100644
--- a/base/doc/ltshipout-code.tex
+++ b/base/doc/ltshipout-code.tex
@@ -1,10 +1,5 @@
% This will typeset documentation + code
%
-% However, you may first have to unpack the .sty file via
-%
-% latex ltshipout.ins
-%
-% as it is used when processing the doumentation.
\AtBeginDocument{\AlsoImplementation}
\input{ltshipout.dtx}
diff --git a/base/doc/ltshipout-doc.tex b/base/doc/ltshipout-doc.tex
index de7f3e30..33f87d88 100644
--- a/base/doc/ltshipout-doc.tex
+++ b/base/doc/ltshipout-doc.tex
@@ -1,10 +1,5 @@
% This will typeset only documentation but not the code
%
-% However, you may first have to unpack the .sty file via
-%
-% latex ltshipout.ins
-%
-% as it is used when processing the doumentation.
\AtBeginDocument{\OnlyDescription
% \let\tableofcontents\relax
diff --git a/base/format.ins b/base/format.ins
index 79069d26..8550680d 100644
--- a/base/format.ins
+++ b/base/format.ins
@@ -200,7 +200,7 @@ the system are in the document `cfgguide.tex'.
\from{ltbibl.dtx}{2ekernel}
\from{ltpage.dtx}{2ekernel}
\from{ltclass.dtx}{2ekernel,tracerollback}
- \from{ltfilehook.dtx}{2ekernel} % L3 layer module
+ \from{ltfilehook.dtx}{2ekernel} % L3 layer module
\from{ltshipout.dtx}{2ekernel} % L3 layer module
\from{ltoutput.dtx}{2ekernel}
% \from{ltclass.dtx}{2ekernel,tracerollback}
@@ -232,6 +232,20 @@ the system are in the document `cfgguide.tex'.
}
+% hook management support
+
+\generate{\file{everyshi-ltx.sty}{\from{ltshipout.dtx}{everyshi-ltx}}} % emulating everyshi
+\generate{\file{atbegshi-ltx.sty}{\from{ltshipout.dtx}{atbegshi-ltx}}} % emulating atbegshi
+\generate{\file{atveryend-ltx.sty}{\from{ltfilehook.dtx}{atveryend-ltx}}} % emulating atveryend
+
+\generate{\file{structuredlog.sty}{\from{ltfilehook.dtx}{structuredlog}}}
+
+%drafts to get removed
+\generate{\file{filehook-ltx.sty}{\from{ltfilehook.dtx}{filehook-draft}}}
+\generate{\file{srclfile-ltx.sty}{\from{ltfilehook.dtx}{scrlfile-draft}}}
+
+
+
% luatex support (TeX part)
\generate{\file{ltluatex.tex}{\from{ltluatex.dtx}{tex,plain}}}
diff --git a/base/ltfilehook.dtx b/base/ltfilehook.dtx
index 6244a743..96ad31c6 100644
--- a/base/ltfilehook.dtx
+++ b/base/ltfilehook.dtx
@@ -1,5 +1,5 @@
% \iffalse meta-comment
-%
+%%
%% File: ltfilehook.dtx (C) Copyright 2020 Frank Mittelbach,
%% Phelype Oleinik & LaTeX Team
%
@@ -1331,6 +1331,69 @@
%</structuredlog>
% \end{macrocode}
+%
+%
+% \subsection{Package \pkg{atveryend} emulation}
+%
+% With the new hook management and the hooks in \cs{enddocument}
+% all of \pkg{atveryend} is taken care of.
+% We can make an emulation only here after the substitution
+% functionality is available:
+% \begin{macrocode}
+%<*2ekernel>
+\declare at file@substitution{atveryend.sty}{atveryend-ltx.sty}
+%</2ekernel>
+% \end{macrocode}
+%
+% Here is the package file we point to:
+% \begin{macrocode}
+%<*atveryend-ltx>
+\ProvidesPackage{atveryend}
+ [2020/08/19 v1.0a
+ Emulation of the original atvery package^^Jwith kernel methods]
+% \end{macrocode}
+%
+%
+% Here are new definitions for its interfaces now pointing to the
+% hooks in \cs{enddocument}
+% \begin{macrocode}
+\newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}}
+\newcommand\AtVeryEndDocument {\AddToHook{enddocument/afteraux}}
+% \end{macrocode}
+% Next one is a bit of a fake, but the result should normally be as
+% expected. If not, one needs to add a rule to sort the code chunks
+% in \hook{enddocument/info}.
+% \begin{macrocode}
+\newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\AtVeryVeryEnd {\AddToHook{enddocument/end}}
+% \end{macrocode}
+
+% \begin{macro}{\BeforeClearDocument}
+% This one is the only one we don't implement or rather don't have
+% a dedicated hook in the code.
+% \begin{macrocode}
+\ExplSyntaxOn
+\newcommand\BeforeClearDocument[1]
+ { \AtEndDocument{#1}
+ \atveryend at DEPRECATED{BeforeClearDocument \tl_to_str:n{#1}}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new:Npn\atveryend at DEPRECATED #1
+ {\iow_term:x{======~DEPRECATED~USAGE~#1~==========}}
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macrocode}
+%</atveryend-ltx>
+% \end{macrocode}
+%
% \Finale
%
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index d67de790..2a68de5b 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -3673,73 +3673,13 @@
% \begin{macrocode}
\cs_new_eq:NN \@expl@@hook at curr@name at pop@
\__hook_curr_name_pop:
-%<@@=hook>
% \end{macrocode}
% \end{macro}
%
%
-%
-% \section{Hooks in \cs{begin} document}
-%
-% Can't have \texttt{@{}@} notation here as this is \LaTeXe{} code
-% \ldots{} and makes for puzzling errors if the double \texttt{@}
-% signs get substituted.
-% \begin{macrocode}
-%<@@=>
-\ExplSyntaxOff
-% \end{macrocode}
-%
-%
-%
-%
-%
-%
-% \subsection{Adjusting at \pkg{atveryend} interfaces}
-%
-% With the new hook management all of \pkg{atveryend} is taken care
-% of.
-%
-% We therefore prevent the package from loading:
-% \begin{macrocode}
-\expandafter\let\csname ver at atveryend.sty\endcsname\fmtversion
-% \end{macrocode}
-%
-%
-% Here are new definitions for its interfaces now pointing to the
-% hooks in \cs{enddocument}
-% \begin{macrocode}
-\newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}}
-\newcommand\AtVeryEndDocument {\AddToHook{enddocument/afteraux}}
-% \end{macrocode}
-% Next one is a bit of a fake, but the result should normally be as
-% expected. If not, one needs to add a rule to sort the code chunks
-% in \hook{enddocument/info}.
-% \begin{macrocode}
-\newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\newcommand\AtVeryVeryEnd {\AddToHook{enddocument/end}}
-% \end{macrocode}
-
-% \begin{macro}{\BeforeClearDocument}
-% This one is the only one we don't implement or rather don't have
-% a dedicated hook in the code.
-% \begin{macrocode}
-\ExplSyntaxOn
-\newcommand\BeforeClearDocument[1]
- { \AtEndDocument{#1}
- \@DEPRECATED{BeforeClearDocument \tl_to_str:n{#1}}
- }
-\cs_new:Npn\@DEPRECATED #1
- {\iow_term:x{======~DEPRECATED~USAGE~#1~==========}}
-% \end{macrocode}
-%
% \begin{macrocode}
\ExplSyntaxOff
% \end{macrocode}
-% \end{macro}
-%
%
% \begin{macrocode}
%</2ekernel>
diff --git a/base/ltmiscen.dtx b/base/ltmiscen.dtx
index 2b1e3c18..2e4ba188 100644
--- a/base/ltmiscen.dtx
+++ b/base/ltmiscen.dtx
@@ -401,6 +401,8 @@
%<*2ekernel>
% \end{macrocode}
%
+%
+%
% \begin{macro}{\@testdef}
% \begin{macrocode}
\def\@testdef #1#2#3{%
diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index 6c173f93..87fdefe2 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -1393,8 +1393,10 @@
%
%
% \subsection{Package \pkg{atbegshi} emulation}
-
-
+%
+%
+%
+%
% \begin{macrocode}
%<*atbegshi-ltx>
@@ -1501,6 +1503,9 @@
%
% \begin{macrocode}
%<*everyshi-ltx>
+% \end{macrocode}
+%
+% \begin{macrocode}
\ProvidesPackage{everyshi}
[2020/08/17 v1.0a
Emulation of the original everyshi package^^Jwith kernel methods]
@@ -1548,14 +1553,11 @@
% \end{macrocode}
%
%
-%
-%
% Rather important :-)
% \begin{macrocode}
%<@@=>
% \end{macrocode}
%
-
% \Finale
%
diff --git a/base/manifest.txt b/base/manifest.txt
index 20866ec2..449b250e 100644
--- a/base/manifest.txt
+++ b/base/manifest.txt
@@ -129,6 +129,13 @@
% preload.dtx -- Code for preloading fonts.
% tulm.fdd -- Font definitions for TU latin modern fonts.
%
+% L3 Programming layer:
+% -----------------
+%
+% ltexpl.dtx -- Basic support
+% lthooks.dtx -- Hook management
+% ltfilehook.dtx -- Hook management for file loading
+% ltshipout.dtx -- Hook management for \shipout
%
% Standard Classes:
% -----------------
diff --git a/base/unpack.ins b/base/unpack.ins
index ed8cb572..3264a401 100644
--- a/base/unpack.ins
+++ b/base/unpack.ins
@@ -123,8 +123,6 @@
\batchinput{latexrelease.ins}
-\batchinput{lthooks.ins}
-
\Msg{}
\Msg{*********************************************}
\Msg{*}
More information about the latex3-commits
mailing list.