From 4e6fb7c03bc033485887a99d2ffeca70ef8c0644 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 27 Feb 2021 03:01:43 +0000
Subject: CTAN sync 202102270301

---
 macros/latex-dev/base/ltexpl.dtx | 68 +++++++++++++---------------------------
 1 file changed, 21 insertions(+), 47 deletions(-)

(limited to 'macros/latex-dev/base/ltexpl.dtx')

diff --git a/macros/latex-dev/base/ltexpl.dtx b/macros/latex-dev/base/ltexpl.dtx
index b642fd72a3..a9be1b0521 100644
--- a/macros/latex-dev/base/ltexpl.dtx
+++ b/macros/latex-dev/base/ltexpl.dtx
@@ -1,7 +1,7 @@
 % \iffalse meta-comment
 %
 % Copyright (C) 2019-2021
-% The LaTeX3 Project and any individual authors listed elsewhere
+% The LaTeX Project and any individual authors listed elsewhere
 % in this file.
 %
 % This file is part of the LaTeX base system.
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltexpl.dtx}
-             [2020/12/18 v1.2h LaTeX Kernel (expl3-dependent code)]
+             [2021/01/24 v1.3a LaTeX Kernel (expl3-dependent code)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltexpl.dtx}
@@ -101,14 +101,16 @@
 % First define some blank commands, so that in case something goes wrong while
 % loading \textsf{expl3}, we won't get strange \texttt{Undefined control
 % sequence} errors.
+% \changes{v1.3a}{2021/01/24}{Define \pkg{expl3} hooks conditionally}
 %    \begin{macrocode}
 %<*2ekernel|latexrelease>
 %<latexrelease>\IncludeInRelease{2020/10/01}%
 %<latexrelease>            {\@expl@sys@load@backend@@}{Roll forward support}%
-\def\@expl@sys@load@backend@@{}
-\def\@expl@push@filename@@{}
-\def\@expl@push@filename@aux@@{}
-\def\@expl@pop@filename@@{}
+\def\reserved@a#1{\ifdefined#1\else\def#1{}\fi}
+\reserved@a\@expl@sys@load@backend@@
+\reserved@a\@expl@push@filename@@
+\reserved@a\@expl@push@filename@aux@@
+\reserved@a\@expl@pop@filename@@
 %<latexrelease>\EndIncludeInRelease
 %</2ekernel|latexrelease>
 %    \end{macrocode}
@@ -188,7 +190,9 @@
 % In \texttt{2ekernel} mode, an error is fatal and building the format
 % is aborted. Use \verb=\batchmode \read -1 to \tokenlist=, which errors
 % with
-% \verb=! Emergency stop. (cannot \read from terminal in nonstop modes)=
+%\begin{verbatim}
+%   ! Emergency stop. (cannot \read from terminal in nonstop modes)
+%\end{verbatim}
 % and aborts the \TeX{} run.  In \texttt{latexrelease} mode, raise an
 % error and do nothing.  Both ways, the error message shows the minimum
 % \textsf{expl3} engine requirements.
@@ -214,7 +218,7 @@
 %</2ekernel>
 %    \end{macrocode}
 %    We do not support a roll forward across 2019. You need to start
-%    with 2019 if you want to get to 2020 or beyond. 
+%    with 2019 if you want to get to 2020 or beyond.
 % \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)}
 %    \begin{macrocode}
 %<*latexrelease>
@@ -225,21 +229,18 @@
            --- I'm giving up!\MessageBreak\MessageBreak
            Note that manually loading the expl3 package\MessageBreak
            from your distribution is not enough}%
-        \@@end  % die
+        \batchmode \read -1 to \reserved@a
 %</latexrelease>
       }%
-      {%
-        \input expl3.ltx
-        \ifdefined\NewDocumentCommand
-        \else
-          \IfFileExists{xparse.ltx}
-            {\input xparse.ltx }
-            {}%
-         \fi
-      }%
+      {\input expl3.ltx }%
   }
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>
+%    \end{macrocode}
+% To support roll-forward for the case where \textsf{xparse} is fully
+% integrated into the kernel, we do not need to repeat the complex test
+% above as we can simply look for the marker command.
+%    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2020/02/02}%
 %<latexrelease>                 {expl3}{Pre-load expl3}%
 %<latexrelease>\IfFileExists{expl3.ltx}
@@ -262,35 +263,8 @@
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
 %
-%
-%    Starting with 2020-10 the kernel contains most of the
-%    \texttt{xparse} interfaces loaded above. These interfaces are
-%    later used to define various user command. However, if somebody
-%    with an earlier installation tries to roll forward (using a
-%    \texttt{latexrelease} package from a newer release) this will not
-%    work as the earlier kernel doesn't contain commands such as
-%    \cs{NewDocumentCommand}.
-%
-%    We therefore add code into \texttt{latexrelease.sty} to load the
-%    \texttt{xparse} package of the current installation instead. this
-%    may not work if the installation is really old, but roll forward
-%    can't do miracles.
-%
-%    If the kernel is 2020-10 or later \cs{NewDocumentCommand} is
-%    already known (whether or not you roll forward or back) so
-%    nothing happens, but if you start from am earlier kernel the
-%    \texttt{xparse} package gets loaded by \texttt{latexrelease}.
-% \changes{v1.2g}{2020/11/24}{Load xparse in latexrelease if needed (gh/434)}
-%    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease>                 {\NewDocumentCommand}{Emergency loading xparse}%
-%<latexrelease>
-%<latexrelease>\ifdefined\NewDocumentCommand \else
-%<latexrelease>  \RequirePackage{xparse}
-%<latexrelease>\fi
-%<latexrelease>
-%<latexrelease>\EndIncludeInRelease
-%    \end{macrocode}
+% \changes{v1.3a}{2021/01/21}
+%                {Move \pkg{xparse} rollback code to \texttt{ltcmd.dtx}}
 %
 %    \subsection{Using expl3 code}
 %
-- 
cgit v1.2.3

