summaryrefslogtreecommitdiff
path: root/macros/latex/base/latexrelease.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/base/latexrelease.dtx')
-rw-r--r--macros/latex/base/latexrelease.dtx42
1 files changed, 28 insertions, 14 deletions
diff --git a/macros/latex/base/latexrelease.dtx b/macros/latex/base/latexrelease.dtx
index 7d2290f4d8..294007553d 100644
--- a/macros/latex/base/latexrelease.dtx
+++ b/macros/latex/base/latexrelease.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2021
+% Copyright (C) 1993-2022
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
@@ -40,7 +40,7 @@
%<*latexrelease>
% \fi
% \ProvidesFile{latexrelease.dtx}
- [2021/04/29 v1.0n LaTeX release emulation and tests
+ [2022/02/28 v1.0o LaTeX release emulation and tests
(including releases up to \latexreleaseversion)]
% \iffalse
%</latexrelease>
@@ -471,7 +471,7 @@
%
%
%
-% \StopEventually{}
+% \MaybeStop{}
%
% \section{Implementation}
%
@@ -487,10 +487,9 @@
% \begin{macro}{\sourceLaTeXdate}
% \changes{v1.0l}{2021/01/23}{\cs{sourceLaTeXdate} added}
% \changes{v1.0m}{2021/03/18}{Define \cs{sourceLaTeXdate} conditionally}
-% Store the original \LaTeX{} format version
-% as a number in the format |YYYYMMDD|. This macro has to
-% be defined conditionally, so that it isn't changed in case
-% \file{latexrelease.sty} is loaded twice (for tests), but it
+% Store the original \LaTeX{} format version as a number in the format
+% |YYYYMMDD |. This macro has to be defined conditionally, so that it
+% isn't changed in case \file{latexrelease.sty} is reloaded, but it
% can't be defined in the kernel only, otherwise
% \file{latexrelease.sty} wouldn't work in older \LaTeX{} due
% to the missing macro.
@@ -619,7 +618,7 @@ of this package available from CTAN}
\catcode58=11 % :
\catcode126=10 % ~
\catcode32=09 % <space>
- \xdef\latexrelease@postexpl{\unexpanded{%
+ \xdef\latexrelease@postltexpl{\unexpanded{%
%<@@=latexrelease>
% \end{macrocode}
%
@@ -691,14 +690,13 @@ of this package available from CTAN}
% store each in \cs{l_@@_restores_tl}, save a copy, and redefine each.
% \begin{macrocode}
\tl_clear_new:N \l_@@_restores_tl
-\cs_gset:Npn \@@_tmp:w #1 #2
+\cs_gset:Npn \@@_redefines:w #1 #2
{
- \quark_if_recursion_tail_stop_do:Nn #1
- { \cs_undefine:N \@@_tmp:w }
+ \quark_if_recursion_tail_stop:N #1
\tl_put_right:Nn \l_@@_restores_tl {#1}
\cs_set_eq:cN { @@_ \cs_to_str:N #1 } #1
\cs_set_eq:NN #1 #2
- \@@_tmp:w
+ \@@_redefines:w
}
% \end{macrocode}
%
@@ -731,12 +729,12 @@ of this package available from CTAN}
% \end{description}
% And here we go:
% \begin{macrocode}
-\@@_tmp:w
+\@@_redefines:w
\__kernel_chk_if_free_cs:N \use_none:n
\e@alloc \@@_e@alloc:NnnnnN
\__kernel_msg_error:nnx \use_none:nnn
\msg_new:nnnn \msg_gset:nnnn
- \NewDocumentCommand \DeclareDocumentCommand
+ % \NewDocumentCommand \DeclareDocumentCommand % after ltcmd.dtx
\newcommand \@@_declare_command:w
% \end{macrocode}
% Temp addition \ldots
@@ -752,6 +750,22 @@ of this package available from CTAN}
\msg_redirect_name:nnn { hooks } { exists } { none }
% \end{macrocode}
%
+% Now a one-off for |ltcmd.dtx|: we need to make \cs{NewDocumentCommand}
+% not complain on an already existing command, but it has to be done
+% after \cs{NewDocumentCommand} is defined, so this is separate from
+% the \cs{latexrelease@postltexpl} actions above:
+% \changes{v1.0o}{2022/02/28}
+% {Move most redefinitions to right after ltexpl.dtx}
+% \begin{macrocode}
+\cs_gset_protected:Npn \latexrelease@postltcmd
+ {
+ \@@_redefines:w
+ \NewDocumentCommand \DeclareDocumentCommand
+ \q_recursion_tail \q_recursion_tail
+ \q_recursion_stop
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
}}%
\endgroup