[latex3-commits] [git/LaTeX3-latex3-latex2e] gh386: Correct option passing when a file is replaced (fixes #386) (c883e8af)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Sep 7 02:41:59 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh386
Link       : https://github.com/latex3/latex2e/commit/c883e8afb335e73b2ab12d117dbba28e5588d12f

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

commit c883e8afb335e73b2ab12d117dbba28e5588d12f
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sun Sep 6 21:41:59 2020 -0300

    Correct option passing when a file is replaced (fixes #386)


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

c883e8afb335e73b2ab12d117dbba28e5588d12f
 base/changes.txt |  5 +++++
 base/ltclass.dtx | 42 ++++++++++++++++++++++++++++++++++--------
 2 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index e20ac7df..7181c965 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2020-08-21  Phelype Oleinik  <phelype.oleinik at latex-project.org>
+
+	* ltclass.dtx:
+	Correct option passing when a file is replaced
+
 2020-08-24  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltfssini.dtx:
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index 7b1dbc81..74feb2c2 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2020/08/29 v1.3p LaTeX Kernel (Class & Package Interface)]
+             [2020/09/06 v1.3q LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -1021,11 +1021,28 @@
 % If the package has been loaded, we check that it was first loaded with
 % the options.  Otherwise we add the option list to that of the package.
 %    \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2020/10/01}{\@pass at ptions}
+%<latexrelease>  {Add file replacement in \@pass at ptions}%
+%<*2ekernel|latexrelease>
 \def\@pass at ptions#1#2#3{%
-  \expandafter\xdef\csname opt@#3.#1\endcsname{%
-    \@ifundefined{opt@#3.#1}\@empty
-      {\csname opt@#3.#1\endcsname,}%
+  \edef\reserved at a{\@expl@@@filehook at resolve@file at subst@@w #3.#1\@nil}%
+  \expandafter\xdef\csname opt@\reserved at a\endcsname{%
+    \@ifundefined{opt@\reserved at a}\@empty
+      {\csname opt@\reserved at a\endcsname,}%
     \zap at space#2 \@empty}}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%
+%<latexrelease>\IncludeInRelease{0000/00/00}{\@pass at ptions}
+%<latexrelease>  {\@pass at ptions}%
+%<latexrelease>\def\@pass at ptions#1#2#3{%
+%<latexrelease>  \expandafter\xdef\csname opt@#3.#1\endcsname{%
+%<latexrelease>    \@ifundefined{opt@#3.#1}\@empty
+%<latexrelease>      {\csname opt@#3.#1\endcsname,}%
+%<latexrelease>    \zap at space#2 \@empty}}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
 \@onlypreamble\@pass at ptions
 %    \end{macrocode}
 %
@@ -1633,8 +1650,6 @@
 \@onlypreamble\@fileswith at pti@ns
 %    \end{macrocode}
 %
-
-
 % \begin{macro}{\load at onefilewithoptions}
 %   This macro is used when loading packages or classes.
 %
@@ -1727,6 +1742,18 @@
          {\@expl@@@filehook at file@push@@
           \set at curr@file{\@currname.\@currext}%
           \@filehook at set@CurrentFile
+%    \end{macrocode}
+%    The \cs{set at curr@file} line below might have replaced the file, so
+%    \cs{@currname} and \cs{@currext} may no longer hold the actual
+%    package being loaded, so in that case we need to update these two
+%    token lists
+%    \begin{macrocode}
+          \ifx\CurrentFile\CurrentFileUsed
+          \else
+            \filename at parse\@curr at file
+            \edef\@currname{\string at makeletter\filename at base}%
+            \edef\@currext{\string at makeletter\filename at ext}%
+          \fi
           \load at onefile@withoptions{#2}%
 %    \end{macrocode}
 %    Now just clean up and exit.
@@ -1764,8 +1791,7 @@
 \let\@unprocessedoptions\@undefined
 %    \end{macrocode}
 % \end{macro}
-
-
+%
 % \begin{macro}{\@missing at onefilewithoptions}
 %    Now the action taken when a file is not found.
 %    \begin{macrocode}





More information about the latex3-commits mailing list.