[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Revert "Make non-expandable macros \protected" (cebffca5)

PhelypeOleinik phelype.oleinik at latex-project.org
Sun Sep 20 22:51:48 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/cebffca5dac3f56b708ffffc889f1a1f75d156de

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

commit cebffca5dac3f56b708ffffc889f1a1f75d156de
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sun Sep 20 17:51:48 2020 -0300

    Revert "Make non-expandable macros \protected"
    
    This reverts commit 341206c3cb8326d6406db133e6ee47b73e30a356.


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

cebffca5dac3f56b708ffffc889f1a1f75d156de
 base/ltshipout.dtx | 79 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 42 insertions(+), 37 deletions(-)

diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx
index e0a38fc3..ed23c5e1 100644
--- a/base/ltshipout.dtx
+++ b/base/ltshipout.dtx
@@ -32,7 +32,7 @@
 %
 %    \begin{macrocode}
 \providecommand\ltshipoutversion{v1.0b}
-\providecommand\ltshipoutdate{2020/09/20}
+\providecommand\ltshipoutdate{2020/09/13}
 %    \end{macrocode}
 %
 %<*driver>
@@ -233,7 +233,7 @@
 %    \cs{AtBeginDvi} is the existing \LaTeXe{} interface to fill the
 %    \hook{shipout/firstpage} hook. This is not really a good name
 %    as it is not just supporting \texttt{.dvi} but also \texttt{.pdf}
-%    output or \texttt{.xdv}.
+%    output or \texttt{.dvx}.
 %
 %    \cs{AtEndDvi} is the counterpart that was not available in the
 %    kernel but only through the package \pkg{atenddvi}. It fills the
@@ -531,11 +531,11 @@
 %    The box filled with the page to be shipped out (both L3 and
 %       \LaTeXe{} name).
 %    \begin{macrocode}
-\box_new:N \l_shipout_box
+\box_new:N  \l_shipout_box
 %    \end{macrocode}
 %    
 %    \begin{macrocode}
-\cs_new_eq:NN \ShipoutBox \l_shipout_box
+\cs_set_eq:NN \ShipoutBox \l_shipout_box
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -547,7 +547,7 @@
 %    follows closely the  ideas from \pkg{atbegshi}, so not
 %    documenting that here for now.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_execute: {
+\cs_set:Npn\@@_execute: {
   \tl_set:Nx \l_@@_group_level_tl
      { \int_value:w \tex_currentgrouplevel:D }
   \tex_afterassignment:D \@@_execute_test_level:
@@ -572,13 +572,14 @@
 %    \end{macrocode}
 %  \end{macro}
 %
+ 
 %
 %  \begin{macro}{\@@_execute_test_level:}
 %    If the group level has changed then we are still constructing
 %    \cs{l_shipout_box} and to continue we need to wait until the
 %    current group has finished, hence the \cs{tex_aftergroup:D}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_execute_test_level: {
+\cs_new:Npn \@@_execute_test_level: {
   \int_compare:nNnT
      \l_@@_group_level_tl < \tex_currentgrouplevel:D 
      \tex_aftergroup:D
@@ -600,7 +601,7 @@
 %    case we don't reset the deadcyles, that would be up to the OR
 %    processing logic to do.}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_execute_cont: {
+\cs_new:Npn \@@_execute_cont: {
   \box_if_empty:NTF \l_shipout_box
     { \PackageWarning{ltshipout}{Ignoring~ void~ shipout~ box} }
     {
@@ -785,7 +786,7 @@
 %    very beginning of the first box shipped out. After that we
 %    redefine it to do nothing on later pages.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_execute_firstpage_hook: {
+\cs_new:Npn \@@_execute_firstpage_hook: {
 %    \end{macrocode}
 %    Adding something to the beginning means adding it to the
 %    background as that  layer is done first in the output. Of course
@@ -800,7 +801,7 @@
 %    is never used again.
 %    \begin{macrocode}
   \cs_gset_eq:NN \@@_execute_firstpage_hook: \prg_do_nothing:
-  \cs_gset_protected:Npn \@@_add_firstpage_material:Nn ##1 ##2 {
+  \cs_gset:Npn \@@_add_firstpage_material:Nn ##1 ##2 {
     \@latex at warning{
         First~ page~ is~ already~ shipped~ out,~ ignoring\MessageBreak
         \string##1 }
@@ -828,8 +829,9 @@
 %    once we are passed the first page it can be used to generate a
 %    warning message mentioning the right user command.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_firstpage_material:Nn #1#2
-  { \AddToHook{shipout/firstpage}{#2} }
+\cs_new:Npn \@@_add_firstpage_material:Nn #1#2 {
+   \AddToHook{shipout/firstpage}{#2}
+}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -844,7 +846,7 @@
 %    \fmi{This could/should perhaps be generalized to set height depth and
 %    width given an arbitrary box.}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_get_box_size:N #1 {
+\cs_new:Npn \@@_get_box_size:N #1 {
   \dim_set:Nn \l_shipout_box_ht_dim { \box_ht:N #1 }
   \dim_set:Nn \l_shipout_box_dp_dim { \box_dp:N #1 }
   \dim_set:Nn \l_shipout_box_wd_dim { \box_wd:N #1 }
@@ -895,7 +897,7 @@
 %    here we are allow for other usage as well, in case some package
 %    has its own output routine.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_background_box:n #1
+\cs_new:Npn \@@_add_background_box:n #1
 { \@@_get_box_size:N \l_shipout_box
 %    \end{macrocode}
 %    But we start testing for a vertical box as that should be the
@@ -988,7 +990,7 @@
 %    Foreground boxes are done in the same way, only the order and
 %    placement of boxes has to be done differently.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_foreground_box:n #1
+\cs_new:Npn \@@_add_foreground_box:n #1
 {
   \box_if_vertical:NTF \l_shipout_box
     {
@@ -1057,7 +1059,7 @@
 %    there might be updates in the preamble or even in the
 %    \hook{begindocument} hook that affects their setup.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_init_page_origins: {
+\cs_new:Npn \@@_init_page_origins: {
   \tl_const:Nx \c_@@_horigin_tl
      {
        \cs_if_exist_use:NTF \pdfvariable { horigin }
@@ -1085,7 +1087,7 @@
 %    \fmi{Could perhaps be generalized as it might be useful elsewhere. For
 %    now it is not.}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_picture_overlay:n #1 {
+\cs_new:Npn \@@_picture_overlay:n #1 {
 %    \end{macrocode}
 %    The very first time this is executed we have ot initializes (and
 %    freeze) the origins.
@@ -1122,8 +1124,9 @@
 %    with its reference point in the top-left corner.
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_background_picture:n #1
-  { \@@_add_background_box:n { \@@_picture_overlay:n {#1} } }
+\cs_new:Npn \@@_add_background_picture:n #1 {
+   \@@_add_background_box:n { \@@_picture_overlay:n {#1} }
+}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1134,8 +1137,9 @@
 %    Put a \texttt{picture} env in  the foreground of the shipout box
 %    with its reference point in the top-left corner.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_foreground_picture:n #1
-  { \@@_add_foreground_box:n { \@@_picture_overlay:n {#1} } }
+\cs_new:Npn \@@_add_foreground_picture:n #1 {
+   \@@_add_foreground_box:n { \@@_picture_overlay:n {#1} }
+}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1147,8 +1151,9 @@
 %    (in case \LaTeX{} looks ahead and is not using the position for
 %    on the next page).
 %    \begin{macrocode}
-\cs_new_protected:Npn \shipout_discard:
-  { \bool_gset_true:N \g_@@_discard_bool }
+\cs_new:Npn \shipout_discard: {
+  \bool_gset_true:N \g_@@_discard_bool
+}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1230,7 +1235,7 @@
 %
 % \begin{macro}{\@kernel at after@enddocument}
 %    \begin{macrocode}
-\tl_gput_right:Nn \@kernel at after@enddocument {
+\g at addto@macro \@kernel at after@enddocument {
   \int_compare:nNnT \@abspage at last = \maxdimen
     {
 %    \end{macrocode}
@@ -1248,7 +1253,7 @@
 %    that in the \texttt{.aux} file for the next run.
 %
 %    \begin{macrocode}
-\tl_gput_right:Nn \@kernel at after@enddocument at afterlastpage {
+\g at addto@macro \@kernel at after@enddocument at afterlastpage {
 %    \end{macrocode}
 %    There is one special case: If no output is produced then there is
 %    no point in a) recording the number as 0 will never match the
@@ -1319,7 +1324,7 @@
 %  \begin{macro}{\@@_excuse_extra_page:}
 %    Say mea culpa \ldots
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_excuse_extra_page: {
+\cs_new:Npn \@@_excuse_extra_page: {
   \vfil
   \begin{center}
     \bfseries Temporary~ page! 
@@ -1374,7 +1379,7 @@
 %  \begin{macro}{\AtBeginDvi}
 %    
 %    \begin{macrocode}
-\cs_new_protected:Npn \AtBeginDvi { \@@_add_firstpage_material:Nn \AtBeginDvi }
+\DeclareRobustCommand \AtBeginDvi {\@@_add_firstpage_material:Nn \AtBeginDvi}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1404,27 +1409,27 @@
 %    Some internals needed elsewhere.
 %
 %    \begin{macrocode}
-\cs_new_eq:NN \@expl@@@shipout at add@firstpage at material@@Nn
+\cs_set_eq:NN \@expl@@@shipout at add@firstpage at material@@Nn
               \__shipout_add_firstpage_material:Nn
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_eq:NN \@expl@@@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_new_eq:NN \@expl@@@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_new_eq:NN \@expl@@@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_new_eq:NN \@expl@@@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}
@@ -1525,7 +1530,7 @@
 %<latexrelease>\IncludeInRelease{2020/10/01}%
 %<latexrelease>                 {\AtEndDvi}{atenddvi emulation}%
 \ExplSyntaxOn
-\cs_new_protected:Npn \AtEndDvi {\AddToHook{shipout/lastpage}}
+\cs_new:Npn \AtEndDvi {\AddToHook{shipout/lastpage}}
 \ExplSyntaxOff
 %    \end{macrocode}
 %    As the package is integrate we prevent loading (no need to roll that back):
@@ -1592,8 +1597,8 @@
 %  \begin{macro}{\AtBeginShipout,\AtBeginShipoutNext}
 %    Filling hooks
 %    \begin{macrocode}
-\protected \def \AtBeginShipout     {\AddToHook{shipout/before}}
-\protected \def \AtBeginShipoutNext {\AddToHookNext{shipout/before}}
+\def \AtBeginShipout     {\AddToHook{shipout/before}}
+\def \AtBeginShipoutNext {\AddToHookNext{shipout/before}}
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -1602,7 +1607,7 @@
 %    Slightly more complex as we need to know the name of the command under which the
 %    \hook{shipout/firstpage} hook is filled.
 %    \begin{macrocode}
-\protected \def \AtBeginShipoutFirst
+\def \AtBeginShipoutFirst
    {\@expl@@@shipout at add@firstpage at material@@Nn \AtBeginShipoutFirst}
 %    \end{macrocode}
 %  \end{macro}
@@ -1682,8 +1687,8 @@
 %  \begin{macro}{\EveryShipout,\AtNextShipout}
 %    This package has only two public commands so simulating it is easy:
 %    \begin{macrocode}
-\protected \def \EveryShipout  {\AddToHook{shipout/before}}
-\protected \def \AtNextShipout {\AddToHookNext{shipout/before}}
+\def \EveryShipout  {\AddToHook{shipout/before}}
+\def \AtNextShipout {\AddToHookNext{shipout/before}}
 %    \end{macrocode}
 %  \end{macro}
 %





More information about the latex3-commits mailing list.