[latex3-commits] [git/LaTeX3-latex3-latex2e] gh239: Make ‘copy’ and ‘if’ commands internal (4af71c70)

PhelypeOleinik tex.phelype at gmail.com
Sun May 10 05:51:44 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh239
Link       : https://github.com/latex3/latex2e/commit/4af71c702c3443d6ed434b03c6bd802a1f63e0bf

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

commit 4af71c702c3443d6ed434b03c6bd802a1f63e0bf
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Sun May 10 00:51:44 2020 -0300

    Make ‘copy’ and ‘if’ commands internal


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

4af71c702c3443d6ed434b03c6bd802a1f63e0bf
 base/ltdefns.dtx | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index 5be24799..090c9635 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -1391,8 +1391,8 @@
 %   tests for the two types of robust command in the kernel.
 %    \begin{macrocode}
 \def\@declarecommandcopylisthook{%
-  {\IfKernelRobustCommand \CopyKernelRobustCommand}%
-  {\IfKernelCmdWithOptArg \CopyKernelCmdWithOptArg}}
+  {\@if at DeclareRobustCommand \@copy at DeclareRobustCommand}%
+  {\@if at newcommand \@copy at newcommand}}
 %    \end{macrocode}
 %
 %   Now the rollback code.
@@ -1414,7 +1414,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\IfKernelRobustCommand,\CopyKernelRobustCommand}
+% \begin{macro}{\@if at DeclareRobustCommand,\@copy at DeclareRobustCommand}
 % \begin{macro}{copy at kernel@robust at command}
 % \changes{v1.5h}{2020/05/09}{Added \cs{DeclareCommandCopy} (gh/239)}
 %
@@ -1423,20 +1423,20 @@
 %   tests are heavily based on Heiko's \cs{LetLtxMacro}, but chopped into
 %   separate macros.
 %
-%   \cs{IfKernelRobustCommand} checks if a command \verb=\cmd= was defined by
+%   \cs{@if at DeclareRobustCommand} checks if a command \verb=\cmd= was defined by
 %   \cs{DeclareRobustCommand}.  The test returns true if the expansion of
 %   \verb=\cmd= is exactly \verb*=\protect\cmd =.
 %
 %    \begin{macrocode}
 %</2ekernel>
-%<latexrelease>\IncludeInRelease{2020-10-01}{\IfKernelRobustCommand}
-%<latexrelease>  {Add \IfKernelRobustCommand, \CopyKernelRobustCommand,
-%<latexrelease>   \IfKernelCmdWithOptArg, and \CopyKernelCmdWithOptArg}%
+%<latexrelease>\IncludeInRelease{2020-10-01}{\@if at DeclareRobustCommand}
+%<latexrelease>  {Add \@if at DeclareRobustCommand, \@copy at DeclareRobustCommand,
+%<latexrelease>   \@if at newcommand, and \@copy at newcommand}%
 %<*2ekernel|latexrelease>
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\def\IfKernelRobustCommand#1{%
+\def\@if at DeclareRobustCommand#1{%
   \edef\reserved at a{\string#1}%
   \def\reserved at b{#1}%
   \edef\reserved at b{\expandafter\strip at prefix\meaning\reserved at b}%
@@ -1458,17 +1458,17 @@
 %    \end{macrocode}
 %
 %   If a command was defined by \cs{DeclareRobustCommand} (that is,
-%   \cs{IfKernelRobustCommand} returns true), then to make a copy of \verb=\cmd=
+%   \cs{@if at DeclareRobustCommand} returns true), then to make a copy of \verb=\cmd=
 %   into \verb=\foo= we define the latter such that it expands to
 %   \verb*=\protect\foo =, then make \verb*=\foo = equal to \verb*=\cmd =.
 %
 %   There is one detail we need to take care of:  if a command was defined with
 %   \cs{DeclareRobustCommand} it may still have an optional argument, in which
 %   case there is one more macro layer before the actual definition of the
-%   command.  We use \cs{IfKernelCmdWithOptArg} to check that and
-%   \cs{CopyKernelCmdWithOptArg} to do the copying.
+%   command.  We use \cs{@if at newcommand} to check that and
+%   \cs{@copy at newcommand} to do the copying.
 %    \begin{macrocode}
-\def\CopyKernelRobustCommand#1#2{%
+\def\@copy at DeclareRobustCommand#1#2{%
   \begingroup
     \escapechar=`\\
     \edef\reserved at a{\string#1}%
@@ -1489,12 +1489,12 @@
     \expandafter\noexpand\csname\string#2 \endcsname}%
   \reserved at a}
 \def\copy at kernel@robust at command#1#2{%
-  \IfKernelCmdWithOptArg#2%
-    {\CopyKernelCmdWithOptArg#1#2}%
+  \@if at newcommand#2%
+    {\@copy at newcommand#1#2}%
     {\let#1#2}}
 %    \end{macrocode}
 %
-% \begin{macro}{\IfKernelCmdWithOptArg,\CopyKernelCmdWithOptArg}
+% \begin{macro}{\@if at newcommand,\@copy at newcommand}
 %
 %   A command \verb=\cmd= (or \verb*=\cmd =, if it was defined with
 %   \cs{DeclareRobustCommand}) with an optional argument will expand to
@@ -1502,7 +1502,7 @@
 %   first three tokens in the expansion of \verb=\cmd=, and return true or false
 %   accordingly.
 %    \begin{macrocode}
-\def\IfKernelCmdWithOptArg#1{%
+\def\@if at newcommand#1{%
   \begingroup
     \escapechar`\\
     \edef\reserved at a{%
@@ -1526,7 +1526,7 @@
 %   \verb=\foo= by defining the latter to expand to
 %   \verb=\@protected at testopt\foo\\foo{<opt>}=.
 %    \begin{macrocode}
-\def\CopyKernelCmdWithOptArg#1#2{%
+\def\@copy at newcommand#1#2{%
   \begingroup
     \escapechar=`\\
     \edef\reserved at a{%
@@ -1546,13 +1546,13 @@
 %    \begin{macrocode}
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
-%<latexrelease>\IncludeInRelease{0000-00-00}{\IfKernelRobustCommand}
-%<latexrelease>  {Undefine \IfKernelRobustCommand, \CopyKernelRobustCommand,
-%<latexrelease>   \IfKernelCmdWithOptArg, and \CopyKernelCmdWithOptArg}%
-%<latexrelease>\let\IfKernelRobustCommand\@undefined
-%<latexrelease>\let\CopyKernelRobustCommand\@undefined
-%<latexrelease>\let\IfKernelCmdWithOptArg\@undefined
-%<latexrelease>\let\CopyKernelCmdWithOptArg\@undefined
+%<latexrelease>\IncludeInRelease{0000-00-00}{\@if at DeclareRobustCommand}
+%<latexrelease>  {Undefine \@if at DeclareRobustCommand, \@copy at DeclareRobustCommand,
+%<latexrelease>   \@if at newcommand, and \@copy at newcommand}%
+%<latexrelease>\let\@if at DeclareRobustCommand\@undefined
+%<latexrelease>\let\@copy at DeclareRobustCommand\@undefined
+%<latexrelease>\let\@if at newcommand\@undefined
+%<latexrelease>\let\@copy at newcommand\@undefined
 %<latexrelease>\EndIncludeInRelease
 %<*2ekernel>
 %    \end{macrocode}





More information about the latex3-commits mailing list.