[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: fix for #379 -- \@reset at ptions need to come after \@popfilename added some missing macrocode (587b6138)

Frank Mittelbach frank.mittelbach at latex-project.org
Sat Aug 29 16:01:58 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/587b613884a1a0bd3e4a89a920ea8e94ecd95bb3

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

commit 587b613884a1a0bd3e4a89a920ea8e94ecd95bb3
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sat Aug 29 16:01:58 2020 +0200

    fix for #379 -- \@reset at ptions need to come after \@popfilename
    added some missing macrocode


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

587b613884a1a0bd3e4a89a920ea8e94ecd95bb3
 base/ltclass.dtx                                   | 12 ++++----
 base/testfiles-lthooks/github-0379.lvt             | 35 ++++++++++++++++++++++
 .../github-0379.tlg}                               |  0
 3 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index 056632e6..ba7fd048 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2020/08/25 v1.3o LaTeX Kernel (Class & Package Interface)]
+             [2020/08/29 v1.3p LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -1702,8 +1702,7 @@
          \MessageBreak
          Try typing \space <return> \space to proceed.}}%
      \@firstofone}%
-    {\@reset at ptions
-     \makeatletter
+    {%
 %    \end{macrocode}
 %    First we take the \meta{name} and \meta{ext} given in the argument
 %    and check if the file exists, and issue an error otherwise asking
@@ -1737,7 +1736,6 @@
 %    Now just clean up and exit.
 %    \begin{macrocode}
           \@expl@@@filehook at file@pop@@}%
-       \@reset at ptions
        \expandafter\@firstofone
      \fi}%
 %    \end{macrocode}
@@ -1757,7 +1755,8 @@
 %         {Added trap for two \cs{LoadClass} commands.}
 %    \begin{macrocode}
      \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi}%
-  \@popfilename}
+    \@popfilename
+    \@reset at ptions}
 %    \end{macrocode}
 %    
 %    \begin{macrocode}
@@ -1787,10 +1786,13 @@
 \def\load at onefile@withoptions#1{%
   \let\CurrentOption\@empty
   \@reset at ptions
+  \makeatletter
+%    \end{macrocode}
 % Grab everything in a macro, so the parameter stack is popped before
 % any processing begins.
 % \changes{v0.2s}{1994/01/17}
 %         {Modify to reduce parameter stack usage}
+%    \begin{macrocode}
   \def\reserved at a{%
     \@pass at ptions\@currext{#1}{\@currname}%
     \global\expandafter
diff --git a/base/testfiles-lthooks/github-0379.lvt b/base/testfiles-lthooks/github-0379.lvt
new file mode 100644
index 00000000..09393dd5
--- /dev/null
+++ b/base/testfiles-lthooks/github-0379.lvt
@@ -0,0 +1,35 @@
+\makeatletter
+\def\@reset at ptions{%
+  \global\ifx\@currext\@clsextension
+  \let\default at ds\OptionNotUsed
+  \typeout{Reset options to ``not used''\on at line}%
+   \else
+    \let\default at ds\@unknownoptionerror
+  \typeout{Reset options to ``error\on at line}%
+  \fi
+  \global\let\ds@\@empty
+  \global\let\@declaredoptions\@empty}
+\makeatother
+
+\begin{filecontents}[force]{foo.cls}
+
+  \RequirePackage{fltrace}     %<--- any require here breaks
+
+  \DeclareOption{draft}{\typeout{draft option}}
+
+  \ProcessOptions
+
+  \LoadClass{article}
+\end{filecontents}
+  
+\START
+
+\input{regression-test}
+
+\documentclass[draft,global]{foo}
+
+\begin{document}
+
+Hello world
+
+\END
diff --git a/base/testfiles-TU/github-0282.tlg b/base/testfiles-lthooks/github-0379.tlg
similarity index 100%
copy from base/testfiles-TU/github-0282.tlg
copy to base/testfiles-lthooks/github-0379.tlg





More information about the latex3-commits mailing list.