[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks2: make emulation packages "2e" and don't expose internals fix macro env (ab86f1e8)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Aug 17 16:36:26 CEST 2020


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

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

commit ab86f1e86039373b751a09404992dd902a05186c
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Aug 17 16:36:26 2020 +0200

    make emulation packages "2e" and don't expose internals
    fix macro env


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

ab86f1e86039373b751a09404992dd902a05186c
 base/ltshipout.dtx | 82 +++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 59 insertions(+), 23 deletions(-)

diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index 0c963757..7533b9f6 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -1301,13 +1301,48 @@
 %  \end{macro}
 
 
-
-
-
-% \section{Package emulation for compatibility}
+% \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}
+%    Some internals needed elsewhere.
+%    \begin{macrocode}
+%<@@=>
+\cs_set_eq:NN \@expl@@shipout at add@firstpage at material@Nn
+              \__shipout_add_firstpage_material:Nn
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_set_eq:NN \@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
+              \__shipout_add_foreground_box:n
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\cs_set_eq:NN \@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
+              \__shipout_add_foreground_picture:n
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%
 %
 %
 %
+% \section{Package emulation for compatibility}
+%
 %
 % \subsection{Package \pkg{atenddvi} emulation}
 %
@@ -1350,13 +1385,12 @@
 \ProvidesPackage{atbegshi}
    [2020/08/17 v1.0a
      Emulation of the original atbegshi package^^Jwith kernel methods]
-\ExplSyntaxOn   
 %    \end{macrocode}
 %
 %
 %  \begin{macro}{\AtBeginShipoutBox}
 %    \begin{macrocode}
-\cs_set_eq:NN \AtBeginShipoutBox \ShipoutBox
+\let \AtBeginShipoutBox \ShipoutBox
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1364,7 +1398,7 @@
 %  \begin{macro}{\AtBeginShipoutInit}
 %    Compatibility only, we aren't delaying \ldots
 %    \begin{macrocode}
-\cs_set_eq:NN \AtBeginShipoutInit \@empty 
+\let \AtBeginShipoutInit \@empty 
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1372,8 +1406,8 @@
 %  \begin{macro}{\AtBeginShipout,\AtBeginShipoutNext}
 %    Filling hooks
 %    \begin{macrocode}
-\cs_new:Npn \AtBeginShipout     {\AddToHook{shipout/before}}
-\cs_new:Npn \AtBeginShipoutNext {\AddToHookNext{shipout/before}}
+\def \AtBeginShipout     {\AddToHook{shipout/before}}
+\def \AtBeginShipoutNext {\AddToHookNext{shipout/before}}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1382,8 +1416,8 @@
 %    Slightly more complex as we need to know the name of the command under which the
 %    \hook{shipout/firstpage} hook is filled.
 %    \begin{macrocode}
-\cs_new:Npn \AtBeginShipoutFirst
-   {\__shipout_add_firstpage_material:Nn \AtBeginShipoutFirst}
+\def \AtBeginShipoutFirst
+   {\@expl@@shipout at add@firstpage at material@Nn \AtBeginShipoutFirst}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1391,7 +1425,7 @@
 %  \begin{macro}{\AtBeginShipoutDiscard}
 %    Just a different name.
 %    \begin{macrocode}
-\cs_new_eq:NN \AtBeginShipoutDiscard \DiscardShipoutBox
+\let \AtBeginShipoutDiscard \DiscardShipoutBox
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1400,13 +1434,17 @@
 %                \AtBeginShipoutUpperLeft,\AtBeginShipoutUpperLeftForeground}
 %    We don't expose them.
 %    \begin{macrocode}
-\cs_set_eq:NN \AtBeginShipoutAddToBox           \__shipout_add_background_box:n
-\cs_set_eq:NN \AtBeginShipoutAddToBoxForeground \__shipout_add_foreground_box:n 
+\let \AtBeginShipoutAddToBox
+              \@expl@@shipout at add@background at box@n
+\let \AtBeginShipoutAddToBoxForeground
+              \@expl@@shipout at add@foreground at box@n 
 %    \end{macrocode}
 %    
 %    \begin{macrocode}
-\cs_set_eq:NN \AtBeginShipoutUpperLeft           \__shipout_add_background_picture:n
-\cs_set_eq:NN \AtBeginShipoutUpperLeftForeground \__shipout_add_foreground_picture:n
+\let \AtBeginShipoutUpperLeft
+              \@expl@@shipout at add@background at pictue@n
+\let \AtBeginShipoutUpperLeftForeground
+              \@expl@@shipout at add@foreground at picture@n 
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1418,15 +1456,14 @@
 %    \verb=\the\ht<box>= value. This may has some implications in some
 %    use cases and if that is a problem then it might need changing.
 %    \begin{macrocode}
+\ExplSyntaxOn  
 \cs_new:Npn \ShipoutBoxHeight { \dim_use:N \l_shipout_box_ht_dim }
 \cs_new:Npn \ShipoutBoxDepth  { \dim_use:N \l_shipout_box_dp_dim }
 \cs_new:Npn \ShipoutBoxWidth  { \dim_use:N \l_shipout_box_wd_dim }
+\ExplSyntaxOff
 %    \end{macrocode}
 %  \end{macro}
 %
-%    \begin{macrocode}
-\ExplSyntaxOff
-%    \end{macrocode}
 %    
 %    \begin{macrocode}
 %</atbegshi-ltx>
@@ -1446,15 +1483,15 @@
 %
 % \subsection{Package \pkg{everyshi} emulation}
 %
-%  \begin{macro}{\EveryShipout,\AtNextShipout}
-%    This package has only two public commands so simulating it is easy:
 %    \begin{macrocode}
 %<*everyshi-ltx>
 \ProvidesPackage{everyshi}
-   [2020/08/16 v1.0a
+   [2020/08/17 v1.0a
     Emulation of the original everyshi package^^Jwith kernel methods]
 %    \end{macrocode}
 %    
+%  \begin{macro}{\EveryShipout,\AtNextShipout}
+%    This package has only two public commands so simulating it is easy:
 %    \begin{macrocode}
 \def \EveryShipout  {\AddToHook{shipout/before}}
 \def \AtNextShipout {\AddToHookNext{shipout/before}}
@@ -1485,7 +1522,6 @@
 %%
 %</everyshi-ltx>
 %    \end{macrocode}
-%  \end{macro}
 %
 %
 %    If the package is requested we substitute the one above:





More information about the latex3-commits mailing list.