From 3ecc00c27119bc47ba26b518b7d26c00b69599df Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 18 Jun 2021 03:01:13 +0000
Subject: CTAN sync 202106180301

---
 macros/latex-dev/base/ltclass.dtx | 75 +++++++++++++++++++++++++++++++++++----
 1 file changed, 68 insertions(+), 7 deletions(-)

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

diff --git a/macros/latex-dev/base/ltclass.dtx b/macros/latex-dev/base/ltclass.dtx
index a0ab0fa354..643587b0ef 100644
--- a/macros/latex-dev/base/ltclass.dtx
+++ b/macros/latex-dev/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2021/05/18 v1.4b LaTeX Kernel (Class & Package Interface)]
+             [2021/06/09 v1.4c LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -757,14 +757,40 @@
 %   needed here to insert a \cs{@empty} to prevent the loss of braces.
 %   \changes{v1.3u}{2020/11/20}{Macro added}
 %   \changes{v1.3w}{2021/01/21}{Add empty entry for latexrelease}
+%   \changes{v1.4c}{2021/06/03}%
+%           {Take care of \cs{@kernel@currpathstack} when rolling
+%            back/forward.}
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
 %<latexrelease>
 %<latexrelease>\IncludeInRelease{2020/10/01}{\@kernel@currpathstack}%
 %<latexrelease>  {Add \@kernel@currpathstack}%
-\gdef\@kernel@currpathstack{}
-%<latexrelease>\g@addto@macro\@kernel@currpathstack{{}}
+%    \end{macrocode}
+%   If rolling backwards to this release, \cs{@kernel@currpathstack}
+%   will be defined, so the \cs{gdef} line should not be executed, thus
+%   the \cs{@gobblethree} will take it out, so the satck isn't touched.
+%    \begin{macrocode}
+%<latexrelease>\@ifundefined{@kernel@currpathstack}{}{\@gobblethree}
+\gdef\@kernel@currpathstack{}%
+%    \end{macrocode}
+%   If rolling forward to this release, then the \cs{gdef} line above
+%   will define the path stack to be empty (which it can't be, inside a
+%   file), so the code below will traverse the \cs{@currnamestack}, and
+%   add as many empty items to \cs{@kernel@currpathstack} as there are
+%   items in \cs{@currnamestack}, so both are back in sync.  Most of the
+%   time \pkg{latexrelease} is loaded on top-level, so only one item is
+%   needed, but \pkg{platexrelease} loads it internally, so the more
+%   complicated loop is needed.
+%    \begin{macrocode}
+%<latexrelease>\ifx\@kernel@currpathstack\@empty
+%<latexrelease>  \def\reserved@a#1#2#3{%
+%<latexrelease>    \ifx\relax#3\else
+%<latexrelease>      \g@addto@macro\@kernel@currpathstack{{}}%
+%<latexrelease>      \expandafter\reserved@a
+%<latexrelease>    \fi}%
+%<latexrelease>  \expandafter\reserved@a\@currnamestack{}{}{\relax}%
+%<latexrelease>\fi
 \def\@p@pfilepath#1{%
   \gdef\@currpath{#1}\@p@pfilepath@aux\@empty}
 \def\@p@pfilepath@aux#1\@nil{%
@@ -1237,10 +1263,14 @@
     \csname opt@\reserved@a\endcsname
 %    \end{macrocode}
 % Extend raw option list
+% \changes{v1.4c}{2021/06/06}
+%         {apply \cs{expandafter} to raw options for gh/580}
 %    \begin{macrocode}
     \@ifundefined{@raw@opt@#3.#1}%
-      {\expandafter\gdef\csname @raw@opt@#3.#1\endcsname{#2}}%
-      {\expandafter\g@addto@macro\csname @raw@opt@#3.#1\endcsname{,#2}}%
+      {\expandafter\gdef\csname @raw@opt@#3.#1\expandafter\endcsname
+                \expandafter{#2}}%
+      {\expandafter\g@addto@macro\csname @raw@opt@#3.#1\expandafter\endcsname
+                \expandafter{\expandafter,#2}}%
 }
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
@@ -1680,15 +1710,39 @@
 %
 % \begin{macro}{\@loadwithoptions}
 % \changes{v1.0t}{1995/11/14}{macro added}
+% \changes{v1.4c}{2021/06/06}
+%         {handle raw options for gh/580}
 % Pass the current option list on to a class or package.
 % |#1| is |\@|\emph{cls-or-pkg}|extension|,
 % |#2| is |\RequirePackage| or |\LoadClass|,
 % |#3| is the class or package to be loaded.
 %    \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2021/06/01}%
+%<latexrelease>                 {\@loadwithoptions}{Raw option lists load with options}%
+%<*2ekernel|latexrelease>
 \def\@loadwithoptions#1#2#3{%
   \expandafter\let\csname opt@#3.#1\expandafter\endcsname
        \csname opt@\@currname.\@currext\endcsname
+  \expandafter\let\csname @raw@opt@#3.#1\expandafter\endcsname
+       \csname @raw@opt@\@currname.\@currext\endcsname
    #2{#3}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{0000/00/00}
+%<latexrelease>                 {\@loadwithoptions}{Raw option lists load with options}%
+%<latexrelease>\def\@loadwithoptions#1#2#3{%
+%<latexrelease>  \expandafter\let\csname opt@#3.#1\expandafter\endcsname
+%<latexrelease>       \csname opt@\@currname.\@currext\endcsname
+%<latexrelease>   #2{#3}}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \@onlypreamble\@loadwithoptions
 %    \end{macrocode}
 % \end{macro}
@@ -2234,10 +2288,15 @@
 %    \end{macrocode}
 % \changes{v1.3u}{2020/11/20}
 %         {Copy option list to the requested package.}
+% \changes{v1.4c}{2021/06/06}
+%         {Copy raw raw options for gh/580}
 %    \begin{macrocode}
     \expandafter\let
       \csname opt@\@currpkg@reqd\expandafter\endcsname
       \csname opt@\@currname.\@currext\endcsname
+    \expandafter\let
+      \csname @raw@opt@\@currpkg@reqd\expandafter\endcsname
+      \csname @raw@opt@\@currname.\@currext\endcsname
     \global\expandafter
     \let\csname ver@\@currname.\@currext\endcsname\@empty
 %    \end{macrocode}
@@ -2712,11 +2771,12 @@
 %    \end{macrocode}
 %
 % Lua\TeX\ has more writes (and 18 is safe here).
+% \changes{v1.4b}{2021/06/09}{Use \cs{@latex@note@no@line} to display the information}
 %    \begin{macrocode}
   \chardef\reserved@c\ifx\directlua\@undefined 15 \else 127 \fi%
   \openin\@inputcheck\q@curr@file \space %
   \ifeof\@inputcheck%
-    \@latex@warning@no@line%
+    \@latex@note@no@line%
         {Writing file `\@currdir\@curr@file'}%
 %    \end{macrocode}
 %
@@ -2730,9 +2790,10 @@
 %
 % \changes{v1.0y}{1997/10/10}
 %         {Use \cs{@gobbletwo}}
+% \changes{v1.4b}{2021/06/09}{Use \cs{@latex@note@no@line} to display the information}
 %    \begin{macrocode}
     \if@filesw%
-      \@latex@warning@no@line%
+      \@latex@note@no@line%
           {File `\@curr@file' already \filec@ntents@where.\MessageBreak%
              Not generating it from this source}%
       \let\write\@gobbletwo%
-- 
cgit v1.2.3

