[latex3-commits] [git/LaTeX3-latex3-latex2e] gh239: Drop \ProvideCommandCopy (a2f1f3be)
PhelypeOleinik
tex.phelype at gmail.com
Sun May 10 04:24:45 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : gh239
Link : https://github.com/latex3/latex2e/commit/a2f1f3be89e847a3bbc0d870f4fdb5a5210da6c7
>---------------------------------------------------------------
commit a2f1f3be89e847a3bbc0d870f4fdb5a5210da6c7
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Sat May 9 23:24:45 2020 -0300
Drop \ProvideCommandCopy
>---------------------------------------------------------------
a2f1f3be89e847a3bbc0d870f4fdb5a5210da6c7
base/ltdefns.dtx | 29 ++++++++++++----------
base/testfiles/github-0239b.lvt | 6 -----
base/testfiles/github-0239b.tlg | 4 ---
.../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 +--
9 files changed, 34 insertions(+), 41 deletions(-)
diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index 4ce6e94d..5be24799 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -1261,8 +1261,7 @@
% \end{macro}
%
%
-% \begin{macro}{\NewCommandCopy,\RenewCommandCopy,
-% \DeclareCommandCopy,\ProvideCommandCopy}
+% \begin{macro}{\NewCommandCopy,\RenewCommandCopy,\DeclareCommandCopy}
% \changes{v1.5h}{2020/05/09}{Added \cs{DeclareCommandCopy} (gh/239)}
%
% With most document level commands being robust now there is more of a
@@ -1285,8 +1284,7 @@
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2020-10-01}{\DeclareCommandCopy}
-%<latexrelease> {Add \NewCommandCopy, \RenewCommandCopy,
-%<latexrelease> \ProvideCommandCopy, and \DeclareCommandCopy}%
+%<latexrelease> {Add \NewCommandCopy, \RenewCommandCopy, and \DeclareCommandCopy}%
%<*2ekernel|latexrelease>
% \end{macrocode}
%
@@ -1301,8 +1299,19 @@
% \cs{RenewCommandCopy} does (almost) the opposite. If the command is
% \emph{not} defined, then an error is raised. But the definition is carried
% out anyhow, so the behaviour is consistent with \cs{renewcommand}.
-% \cs{ProvideCommandCopy} only carries out the definition if \verb=#1= is not
-% yet defined, otherwise it does nothing.
+%
+% A \cs{ProvideCommandCopy} isn't defined because it's not reasonably useful.
+% \verb=\provide...= commands mean ``define this if there's no other
+% definition'', but copying a command (usually) implies that the command being
+% copied is defined, so \cs{ProvideCommandCopy} doesn't make a lot of sense.
+% But more importantly, the most common use case of copying a command is to
+% redefine it later, while preserving the old definition, as in:
+% \begin{verbatim}
+% \ProvideComandCopy \A \B
+% \renewcommand \B { ... \A ...}
+% \end{verbatim}
+% then, if \verb=\A= is already defined the first line is skipped, an in this
+% case \verb=\B= won't work as expected.
% \begin{macrocode}
\def\NewCommandCopy{%
\declare at commandcopy%
@@ -1313,10 +1322,6 @@
{\@latex at error{Command \@backslashchar\reserved at a\space undefined}\@ehc
\@firstofone}%
{\@firstofone}}
-\def\ProvideCommandCopy{%
- \declare at commandcopy%
- {\@firstofone}%
- {\@gobble}}
\def\DeclareCommandCopy{%
\declare at commandcopy%
{\@firstofone}%
@@ -1395,12 +1400,10 @@
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000-00-00}{\DeclareCommandCopy}
-%<latexrelease> {Undefine \NewCommandCopy, \RenewCommandCopy,
-%<latexrelease> \ProvideCommandCopy, and \DeclareCommandCopy}%
+%<latexrelease> {Undefine \NewCommandCopy, \RenewCommandCopy, and \DeclareCommandCopy}%
%<latexrelease>\let\NewCommandCopy\@undefined
%<latexrelease>\let\RenewCommandCopy\@undefined
%<latexrelease>\let\DeclareCommandCopy\@undefined
-%<latexrelease>\let\ProvideCommandCopy\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
diff --git a/base/testfiles/github-0239b.lvt b/base/testfiles/github-0239b.lvt
index 046d568d..c87e0648 100644
--- a/base/testfiles/github-0239b.lvt
+++ b/base/testfiles/github-0239b.lvt
@@ -30,12 +30,6 @@
\expect{\exists =macro:->another|}
\test\RenewCommandCopy\exists\another
-\expect{\tmpc =macro:->another|}
-\test\ProvideCommandCopy\tmpc\another
-
-\expect{\exists =macro:->exists|}
-\test\ProvideCommandCopy\exists\another
-
\expect{\tmpd =macro:->another|}
\test\DeclareCommandCopy\tmpd\another
diff --git a/base/testfiles/github-0239b.tlg b/base/testfiles/github-0239b.tlg
index 9910b408..1464a95e 100644
--- a/base/testfiles/github-0239b.tlg
+++ b/base/testfiles/github-0239b.tlg
@@ -24,10 +24,6 @@ If that doesn't work, type X <return> to quit.
\tmpb =macro:->another|
\exists =macro:->another|
\exists =macro:->another|
-\tmpc =macro:->another|
-\tmpc =macro:->another|
-\exists =macro:->exists|
-\exists =macro:->exists|
\tmpd =macro:->another|
\tmpd =macro:->another|
\exists =macro:->another|
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
index 30bfe7bb..a5b7588d 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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
@@ -326,8 +326,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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
index 3fc5b835..aae77447 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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
@@ -318,8 +318,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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness 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 6a8d3e3a..990e5ef1 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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
@@ -327,8 +327,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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.luatex.tlg b/base/testfiles/tlb-rollback-004-often.luatex.tlg
index 964eaf4f..1ed25ea8 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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.tlg b/base/testfiles/tlb-rollback-004-often.tlg
index b8ade86d..b4af6574 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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.xetex.tlg b/base/testfiles/tlb-rollback-004-often.xetex.tlg
index b17402b7..651854fc 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: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
-Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , \ProvideCommandCopy , and \DeclareCommandCopy on input line ....
+Skipping: [....-..-..] Add \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
+Applying: [....-..-..] Undefine \NewCommandCopy , \RenewCommandCopy , and \DeclareCommandCopy on input line ....
Skipping: [....-..-..] Add \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ...
Applying: [....-..-..] Undefine \IfKernelRobustCommand , \CopyKernelRobustCommand , \IfKernelCmdWithOptArg , and \CopyKernelCmdWithOptArg on input line ....
Applying: [....-..-..] Undo robustness on input line ....
More information about the latex3-commits
mailing list.