[latex3-commits] [git/LaTeX3-latex3-latex2e] gh239: Rename \LetRobustCommand to \DeclareCommandCopy (61706ea4)

PhelypeOleinik tex.phelype at gmail.com
Thu May 7 14:11:55 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh239
Link       : https://github.com/latex3/latex2e/commit/61706ea409da2d88cad7ba156e78dee225f7b0a5

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

commit 61706ea409da2d88cad7ba156e78dee225f7b0a5
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Thu May 7 09:11:55 2020 -0300

    Rename \LetRobustCommand to \DeclareCommandCopy


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

61706ea409da2d88cad7ba156e78dee225f7b0a5
 base/ltdefns.dtx                                   | 74 +++++++++++-----------
 base/testfiles/github-0239.lvt                     |  2 +-
 .../tlb-latexrelease-rollback-003-often.luatex.tlg |  8 +--
 .../tlb-latexrelease-rollback-003-often.tlg        |  8 +--
 .../tlb-latexrelease-rollback-003-often.xetex.tlg  |  8 +--
 base/testfiles/tlb-rollback-004-often.luatex.tlg   |  4 +-
 base/testfiles/tlb-rollback-004-often.tlg          |  4 +-
 base/testfiles/tlb-rollback-004-often.xetex.tlg    |  4 +-
 8 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index 53d1c444..8309822b 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -1261,13 +1261,13 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\LetRobustCommand}
+% \begin{macro}{\DeclareCommandCopy}
 % \changes{v1.5h}{2020/05/01}{Added macro (gh/239)}
 %
 %   With most document level commands being robust now there is more of a
 %   requirement to have a standard way of aliasing (or copying) a command to a
 %   new name, for example to save an original definition before changing a
-%   command.  \cs{LetRobustCommand} is analogous to \TeX's \cs{let}, except that
+%   command.  \cs{DeclareCommandCopy} is analogous to \TeX's \cs{let}, except that
 %   it copes with the different types of robust commands defined by \LaTeX's
 %   mechanisms.
 %
@@ -1276,19 +1276,19 @@
 %   $\epsilon$-\TeX.
 %    \begin{macrocode}
 %</2ekernel>
-%<latexrelease>\IncludeInRelease{2020/10/01}{\LetRobustCommand}{\LetRobustCommand}%
+%<latexrelease>\IncludeInRelease{2020/10/01}{\DeclareCommandCopy}{\DeclareCommandCopy}%
 %<*2ekernel|latexrelease>
 %    \end{macrocode}
-%   \cs{LetRobustCommand} just calls \cs{let at robustcommand} with a \cs{relax}
+%   \cs{DeclareCommandCopy} just calls \cs{declare at commandcopy} with a \cs{relax}
 %   which serves as a prefix for definitions.  Heiko's \pkg{letltxmacro} defines
 %   a global variant of \cs{LetLtxMacro}, but since none of our definition
 %   commands have a global version, this one won't either, for consistency.
 %    \begin{macrocode}
-\def\LetRobustCommand{\let at robustcommand\relax}
+\def\DeclareCommandCopy{\declare at commandcopy\relax}
 %    \end{macrocode}
 %   Start by saving the current value of \cs{escapechar} and setting it to $-1$.
 %    \begin{macrocode}
-\def\let at robustcommand#1#2#3{%
+\def\declare at commandcopy#1#2#3{%
   \edef\reserved at a{\the\escapechar}%
   \escapechar=-1 %
 %    \end{macrocode}
@@ -1296,7 +1296,7 @@
 %   \verb*=\protect\#3 =.  This is the case when \verb=#3= is a multi-letter
 %   control sequence defined with \cs{DeclareRobustCommand}.  In this case we
 %   copy \verb*=\#3 = into \verb*=\#2 = and then call the inner
-%   \cs{let at robust@command} with \verb*=\#2 = and \verb*=\#3 = rather than
+%   \cs{declare at command@copy} with \verb*=\#2 = and \verb*=\#3 = rather than
 %   \verb*=\#2= and \verb*=\#3=.
 %    \begin{macrocode}
   \edef\reserved at b{%
@@ -1312,15 +1312,15 @@
     #1\expandafter\let
     \csname\string#2 \expandafter\endcsname
     \csname\string#3 \endcsname
-    \expandafter\let at robust@command
+    \expandafter\declare at command@copy
       \csname\string#2 \expandafter\endcsname
       \csname\string#3 \endcsname{#1}%
 %    \end{macrocode}
-%   Otherwise just call \cs{let at robust@command} with \verb*=\#2= and \verb*=\#3=
+%   Otherwise just call \cs{declare at command@copy} with \verb*=\#2= and \verb*=\#3=
 %   to do the heavy-lifting.
 %    \begin{macrocode}
   \else
-    \let at robust@command{#2}{#3}{#1}%
+    \declare at command@copy{#2}{#3}{#1}%
   \fi
 %    \end{macrocode}
 %   Reset \cs{escapechar} when we're done.
@@ -1330,13 +1330,13 @@
 %    \end{macrocode}
 %   Check if the \verb=#2= is actually a macro, otherwise just use \cs{let}.
 %    \begin{macrocode}
-\def\let at robust@command#1#2#3{%
+\def\declare at command@copy#1#2#3{%
   \escapechar=92 %
-  \expandafter\let at robust@chk at parm\meaning#2:->\@nil{%
+  \expandafter\declare at copy@chk at parm\meaning#2:->\@nil{%
 %    \end{macrocode}
 %   Now the real fun begins.  We'll redefine (in a group) some of \LaTeX's
 %   optional argument-processing macros because TODO
-%   Also make \cs{let at robust@testopt} equal to \cs{@empty} to signal no optional
+%   Also make \cs{declare at copy@testopt} equal to \cs{@empty} to signal no optional
 %   argument (may change).
 %    \begin{macrocode}
     \begingroup
@@ -1344,7 +1344,7 @@
         \expandafter\@testopt\@gobble}%
       \def\@testopt##1##2{%
         \toks@={##2}}%
-      \let\let at robust@testopt\@empty
+      \let\declare at copy@testopt\@empty
 %    \end{macrocode}
 %   Define \cs{reserved at c} as \verb=\@protected at testopt\#2\\#2=\ldots
 %    \begin{macrocode}
@@ -1359,16 +1359,16 @@
 %    \begin{macrocode}
       \edef\reserved at d{%
         \unexpanded\expandafter\expandafter\expandafter
-          {\expandafter\let at robust@CarThree#2{}{}{}\@nil}}
+          {\expandafter\declare at copy@CarThree#2{}{}{}\@nil}}
 %    \end{macrocode}
 %   then compare both.  If they are equal, the macro contains a test for an
 %   optional argument, in which case \verb=#2= is executed, so that the default
 %   value of the optional argument is stored in \cs{toks@} and
-%   \cs{let at robust@testopt} is redefined accordingly.
+%   \cs{declare at copy@testopt} is redefined accordingly.
 %    \begin{macrocode}
       \ifx\reserved at c\reserved at d
         #2%
-        \def\let at robust@testopt{%
+        \def\declare at copy@testopt{%
           \noexpand\@protected at testopt
           \noexpand#1%
         }%
@@ -1386,45 +1386,45 @@
 %   and \cs{reserved at d} as the first two (or fewer) tokens in the expansion of
 %   \verb=#2=.  Now if they are equal, execute \verb=#2= so that the default
 %   value of the optional argument of \verb=#2= is stored in \cs{toks@}, and
-%   then reassign \cs{let at robust@testopt} to be \cs{@testopt}.
+%   then reassign \cs{declare at copy@testopt} to be \cs{@testopt}.
 %    \begin{macrocode}
         \edef\reserved at d{%
           \unexpanded\expandafter\expandafter\expandafter
-            {\expandafter\let at robust@CarTwo#2{}{}{}\@nil}}
+            {\expandafter\declare at copy@CarTwo#2{}{}{}\@nil}}
         \ifx\reserved at c\reserved at d
           #2%
-          \def\let at robust@testopt{%
+          \def\declare at copy@testopt{%
             \noexpand\@testopt
           }%
         \fi
       \fi
 %    \end{macrocode}
-%   Now, unless \cs{let at robust@testopt} is empty (that is, no optional argument)
-%   define \cs{let at robust@GlobalTemp} to be
+%   Now, unless \cs{declare at copy@testopt} is empty (that is, no optional argument)
+%   define \cs{declare at copy@GlobalTemp} to be
 %   \meta{testopt}\cs{\#1}\{\meta{opt-default}\}, where
 %   \meta{testopt} is either \verb=\@protected at testopt\#2=, or \verb=\@testopt=.
 %    \begin{macrocode}
-      \ifx\let at robust@testopt\@empty
+      \ifx\declare at copy@testopt\@empty
       \else
-        \let at robust@protected\xdef\let at robust@GlobalTemp{%
-          \let at robust@testopt
+        \declare at copy@protected\xdef\declare at copy@GlobalTemp{%
+          \declare at copy@testopt
           \expandafter\noexpand
           \csname\string#1\endcsname
           {\the\toks@}%
         }%
       \fi
 %    \end{macrocode}
-%   We're almost done now.  If \cs{let at robust@testopt} remained empty all along,
+%   We're almost done now.  If \cs{declare at copy@testopt} remained empty all along,
 %   then the macro didn't have an optional argument and we just need to \cs{let}
 %   one to the other.
 %   Otherwise we \cs{let} \verb=\#1=, the top-level macro, to
-%   \cs{let at robust@GlobalTemp}, and then \cs{let} \verb=\\#1= to \verb=\\#2=,
+%   \cs{declare at copy@GlobalTemp}, and then \cs{let} \verb=\\#1= to \verb=\\#2=,
 %   which is the actual definition of the macro.
 %    \begin{macrocode}
-    \expandafter\endgroup\ifx\let at robust@testopt\@empty
+    \expandafter\endgroup\ifx\declare at copy@testopt\@empty
       #3\let#1=#2\relax
     \else
-      #3\let#1=\let at robust@GlobalTemp
+      #3\let#1=\declare at copy@GlobalTemp
       #3\expandafter\let
           \csname\string#1\expandafter\endcsname
           \csname\string#2\endcsname
@@ -1437,17 +1437,17 @@
 %   This auxiliary detects whether the argument is a macro (otherwise this
 %   entire process boils down to \TeX's \cs{let}), and in case of a
 %   \cs{protected} macro (using \pkg{etoolbox}'s \cs{newrobustcmd}), define
-%   \cs{let at robust@protected} accordingly.
+%   \cs{declare at copy@protected} accordingly.
 %    \begin{macrocode}
-\def\let at robust@chk at parm#1:->#2\@nil{%
+\def\declare at copy@chk at parm#1:->#2\@nil{%
   \tmp at strifeq{#1}{macro}%
     {%
-      \def\let at robust@protected{}%
+      \def\declare at copy@protected{}%
       \@firstoftwo
     }{%
       \tmp at strifeq{#1}{\protected macro}%
         {%
-          \def\let at robust@protected{\protected}%
+          \def\declare at copy@protected{\protected}%
           \@firstoftwo%
         }
         {\@secondoftwo}%
@@ -1471,12 +1471,12 @@
 %    \end{macrocode}
 %   Takes the first two or three tokens of the argument.
 %    \begin{macrocode}
-\def\let at robust@CarTwo#1#2#3\@nil{#1#2}%
-\def\let at robust@CarThree#1#2#3#4\@nil{#1#2#3}%
+\def\declare at copy@CarTwo#1#2#3\@nil{#1#2}%
+\def\declare at copy@CarThree#1#2#3#4\@nil{#1#2#3}%
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
-%<latexrelease>\IncludeInRelease{0000/00/00}{\LetRobustCommand}{\LetRobustCommand}%
-%<latexrelease>\let\LetRobustCommand\@undefined
+%<latexrelease>\IncludeInRelease{0000/00/00}{\DeclareCommandCopy}{\DeclareCommandCopy}%
+%<latexrelease>\let\DeclareCommandCopy\@undefined
 %<latexrelease>\EndIncludeInRelease
 %<*2ekernel>
 %    \end{macrocode}
diff --git a/base/testfiles/github-0239.lvt b/base/testfiles/github-0239.lvt
index ef43b8b7..417675d3 100644
--- a/base/testfiles/github-0239.lvt
+++ b/base/testfiles/github-0239.lvt
@@ -10,7 +10,7 @@
 
 \def\testt#1#2#3#4{%
   #4%
-  \LetRobustCommand#1#3%
+  \DeclareCommandCopy#1#3%
   \testtt#1
   \expandafter\testtt\csname#2\space\endcsname
   \expandafter\testtt\csname\string#1\endcsname
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
index 8f09d413..df0862a9 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
@@ -13,8 +13,8 @@ Applying: [....-..-..] Final dot for extension on input line ....
 Skipping: [....-..-..] \MakeRobust  on input line ....
 Skipping: [....-..-..] \MakeRobust  on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Skipping: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
@@ -324,8 +324,8 @@ Already applied: [....-..-..] Final dot for extension on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Already applied: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
index cf9bedf3..f12a33d4 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
@@ -11,8 +11,8 @@ Applying: [....-..-..] Final dot for extension on input line ....
 Skipping: [....-..-..] \MakeRobust  on input line ....
 Skipping: [....-..-..] \MakeRobust  on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Skipping: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
@@ -316,8 +316,8 @@ Already applied: [....-..-..] Final dot for extension on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Already applied: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
index b864a35b..ff8acb7c 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
@@ -11,8 +11,8 @@ Applying: [....-..-..] Final dot for extension on input line ....
 Skipping: [....-..-..] \MakeRobust  on input line ....
 Skipping: [....-..-..] \MakeRobust  on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Skipping: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
@@ -325,8 +325,8 @@ Already applied: [....-..-..] Final dot for extension on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Already applied: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.luatex.tlg b/base/testfiles/tlb-rollback-004-often.luatex.tlg
index a6b3cafe..f8be7e33 100644
--- a/base/testfiles/tlb-rollback-004-often.luatex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.luatex.tlg
@@ -10,8 +10,8 @@ Already applied: [....-..-..] Final dot for extension on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Already applied: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.tlg b/base/testfiles/tlb-rollback-004-often.tlg
index 586d0c31..790c83cb 100644
--- a/base/testfiles/tlb-rollback-004-often.tlg
+++ b/base/testfiles/tlb-rollback-004-often.tlg
@@ -8,8 +8,8 @@ Already applied: [....-..-..] Final dot for extension on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Already applied: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.xetex.tlg b/base/testfiles/tlb-rollback-004-often.xetex.tlg
index f37c5333..0f2c1571 100644
--- a/base/testfiles/tlb-rollback-004-often.xetex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.xetex.tlg
@@ -8,8 +8,8 @@ Already applied: [....-..-..] Final dot for extension on input line ....
 Applying: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
 Already applied: [....-..-..] \MakeRobust  on input line ....
-Skipping: [....-..-..] \LetRobustCommand  on input line ....
-Applying: [....-..-..] \LetRobustCommand  on input line ....
+Skipping: [....-..-..] \DeclareCommandCopy  on input line ....
+Applying: [....-..-..] \DeclareCommandCopy  on input line ....
 Applying: [....-..-..] Undo robustness on input line ....
 Applying: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....
 Already applied: [....-..-..] Leave commands undefined in \@ifundefined  on input line ....





More information about the latex3-commits mailing list.