[latex3-commits] [git/LaTeX3-latex3-latex2e] gh513: modify \ProcessOptions* as suggested in issue #513 (c3522690)

David Carlisle d.p.carlisle at gmail.com
Sat Mar 6 00:21:49 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh513
Link       : https://github.com/latex3/latex2e/commit/c352269047a2d80a4017e16fec07227e1f0e9fce

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

commit c352269047a2d80a4017e16fec07227e1f0e9fce
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Fri Mar 5 23:21:49 2021 +0000

    modify \ProcessOptions* as suggested in issue #513


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

c352269047a2d80a4017e16fec07227e1f0e9fce
 base/changes.txt                                   |  6 ++++
 base/ltclass.dtx                                   | 41 ++++++++++++++++++----
 base/testfiles/github-0513.lvt                     |  7 ++++
 .../testfiles/{github-0109.tlg => github-0513.tlg} |  6 ++--
 4 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 6cb6e64f..a8c45bc5 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-03-05  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* base/ltclass.dtx: Modify \ProcessOption* handling so key=value
+	terms can be safely skipped (gh/513)
+
+
 2021-03-03  Phelype Oleinik  <phelype.oleinik at latex-project.org>
 
 	* ltclass.dtx:
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index f04eef8b..2b14d58d 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2021/03/03 v1.3y LaTeX Kernel (Class & Package Interface)]
+             [2021/03/05 v1.3z LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -1072,7 +1072,7 @@
 %<latexrelease>     \csname ver@\@currname.\@currext\endcsname{#1}%
 %<latexrelease>\ifx\@currext\@clsextension
 %<latexrelease>    \typeout{Document Class: \@gtempa\space#1}%
-%<latexrelease>  \else
+%<latexrelease>  \else at xprocess@ptions
 %<latexrelease>    \protected at wlog{Package: \@gtempa\space#1}%   <--- protected
 %<latexrelease>  \fi}
 %<latexrelease>
@@ -1378,19 +1378,48 @@
 %
 % \changes{v0.2y}{1994/02/07}
 %         {Add extra ,s so `two' is not matched with `twocolumn'}
+% \changes{v1.3z}{2021/03/05}{modify so braces to not give errors (gh/513)}
 %    \begin{macrocode}
+%</2ekernel>
+%<latexrelease>\IncludeInRelease{2021/05/01}%
+%<latexrelease>                 {\@xprocess at ptions}{safer @xprocess at ptions}%
+%<*2ekernel|latexrelease>
 \def\@xprocess at ptions{%
   \ifx\@currext\@clsextension\else
     \@for\CurrentOption:=\@classoptionslist\do{%
       \ifx\CurrentOption\@empty\else
-        \@expandtwoargs\in@{,\CurrentOption,}{,\@declaredoptions,}%
-        \ifin@
+        \@ifundefined{ds@\CurrentOption}{}{%
           \@use at ption
           \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
-        \fi
+        }%
       \fi}%
   \fi
   \@process at pti@ns}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\@xprocess at ptions}{safer @xprocess at ptions}%
+%<latexrelease>\let\@remove at eq@value\@undefined
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<latexrelease>\def\@xprocess at ptions{%
+%<latexrelease>  \ifx\@currext\@clsextension\else
+%<latexrelease>    \@for\CurrentOption:=\@classoptionslist\do{%
+%<latexrelease>      \ifx\CurrentOption\@empty\else
+%<latexrelease>        \@expandtwoargs\in@{,\CurrentOption,}{,\@declaredoptions,}%
+%<latexrelease>        \ifin@
+%<latexrelease>          \@use at ption
+%<latexrelease>          \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
+%<latexrelease>        \fi
+%<latexrelease>      \fi}%
+%<latexrelease>  \fi
+%<latexrelease>  \@process at pti@ns}
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \@onlypreamble\@xprocess at ptions
 %    \end{macrocode}
 %
@@ -1954,7 +1983,7 @@
 %   \usepackage{some/local/path/array}
 %   \usepackage{array}
 % \end{verbatim}
-%    won't load \file{array.sty} twice.  It is remotely possible that
+%    won't load |array.sty| twice.  It is remotely possible that
 %    those are two different files, but as a matter of principles, we
 %    will consider that the base file name uniquely identifies a
 %    package, regardless of where it lives.  This assumption already
diff --git a/base/testfiles/github-0513.lvt b/base/testfiles/github-0513.lvt
new file mode 100644
index 00000000..903271de
--- /dev/null
+++ b/base/testfiles/github-0513.lvt
@@ -0,0 +1,7 @@
+
+\input{test2e}
+\documentclass[foo={bar,BAR}]{article}
+% should be no error
+\START
+\usepackage{fontenc}% uses\ProcessOptions*
+\END
\ No newline at end of file
diff --git a/base/testfiles/github-0109.tlg b/base/testfiles/github-0513.tlg
similarity index 59%
copy from base/testfiles/github-0109.tlg
copy to base/testfiles/github-0513.tlg
index bdde2283..0aa6df9b 100644
--- a/base/testfiles/github-0109.tlg
+++ b/base/testfiles/github-0513.tlg
@@ -1,7 +1,5 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-(github-0109-2.tex
-file 2
-) (github-0109-1.tex
-file 1
+(fontenc.sty
+Package: fontenc ....-..-.. v... Standard LaTeX package
 )





More information about the latex3-commits mailing list.