[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh862: Use raw options for keyval handing (a76984e4)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jun 20 08:45:07 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh862
Link       : https://github.com/latex3/latex2e/commit/a76984e4bd920ca69aef412eea7e7b5c708ac114

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

commit a76984e4bd920ca69aef412eea7e7b5c708ac114
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jun 20 07:45:07 2022 +0100

    Use raw options for keyval handing


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

a76984e4bd920ca69aef412eea7e7b5c708ac114
 base/changes.txt                                    |  6 ++++++
 base/ltkeys.dtx                                     | 20 ++++++++++++--------
 base/testfiles/github-0862.lvt                      | 16 ++++++++++++++++
 base/testfiles/{github-0109.tlg => github-0862.tlg} |  8 ++++----
 4 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 4ccff60e..a31ee463 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,12 @@ are not part of the distribution.
 All changes above are only part of the development branch for the next release.
 ================================================================================
 
+
+2022-06-20  Joseph Wright <Joseph.Wright at latex-project.org>
+
+	* ltkeys.dtx (subsection{Main mechanism})
+	Use raw options data for keyval handling
+
 #########################
 # 2022-06-01 PL1 Release
 #########################
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index c6dfa5f6..f3bc4942 100644
--- a/base/ltkeys.dtx
+++ b/base/ltkeys.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltkeys.dtx}
-             [2022/06/16 v1.0g LaTeX Kernel (Kevyal options)]
+             [2022/06/20 v1.0h LaTeX Kernel (Kevyal options)]
 % \iffalse
 \documentclass{l3doc}
 \GetFileInfo{ltkeys.dtx}
@@ -258,6 +258,7 @@
 %
 % \begin{macro}{\@@_options_global:n}
 % \changes{v1.0f}{2022/03/18}{Simplify to always cover global options}
+% \changes{v1.0h}{2022/06/20}{Use raw options data}
 %   Global (class) options are handled differently for \LaTeXe{} packages
 %   and classes. Hence this function is essentially a check on the current
 %  file type. The initial test is needed as \LaTeXe{} allows variables to
@@ -266,7 +267,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_options_global:n #1
   {
-    \cs_if_eq:NNF \@classoptionslist \scan_stop:
+    \cs_if_eq:NNF \@raw at classoptionslist \scan_stop:
       {
         \cs_if_eq:NNTF \@currext \@clsextension
           { \@@_options_class:n {#1} }
@@ -278,6 +279,7 @@
 %
 % \begin{macro}{\@@_options_class:n}
 % \changes{v1.0g}{2022/06/16}{Better handling of option removal}
+% \changes{v1.0h}{2022/06/20}{Use raw options data}
 % \begin{macro}{\@@_options_remove:nnn}
 % \changes{v1.0g}{2022/06/16}{New function}
 %   For classes, each option (stripped of any content after |=|)
@@ -289,15 +291,15 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_options_class:n #1
   {
-    \cs_if_free:cF { opt@ \@currname . \@currext }
+    \cs_if_free:cF { @raw at opt@ \@currname . \@currext }
       {
         \keys_if_exist:nnTF {#1} { unknown }
           {
             \clist_put_right:Nv \l_@@_options_clist
-              { opt@ \@currname . \@currext }
+              { @raw at opt@ \@currname . \@currext }
           }
           {
-            \clist_map_inline:cn { opt@ \@currname . \@currext }
+            \clist_map_inline:cn { @raw at opt@ \@currname . \@currext }
               {
                 \@@_options_remove:enn
                   { \@@_remove_equals:n {##1} }
@@ -319,6 +321,7 @@
 %
 % \begin{macro}{\@@_options_package:n}
 % \changes{v1.0g}{2022/06/16}{Better handling of option removal}
+% \changes{v1.0h}{2022/06/20}{Use raw options data}
 %   For global options when processing a package, the tasks are slightly
 %   different from those for a class. The check is the same, but here
 %   there is nothing to do if the option is not applicable. Each valid
@@ -326,7 +329,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_options_package:n #1
   {
-    \clist_map_inline:Nn \@classoptionslist
+    \clist_map_inline:Nn \@raw at classoptionslist
       {
         \@@_options_remove:enn
           { \@@_remove_equals:n {##1} }
@@ -337,6 +340,7 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_options_local:}
+% \changes{v1.0h}{2022/06/20}{Use raw options data}
 %   If local options are found, the are added to the processing list.
 %   \LaTeXe{} stores options for each file in a macro which may or may not
 %   exist, hence the need to use \cs{cs_if_exist:c}.
@@ -345,10 +349,10 @@
   {
     \cs_if_eq:NNF \@currext \@clsextension
       {
-        \cs_if_exist:cT { opt@ \@currname . \@currext }
+        \cs_if_exist:cT { @raw at opt@ \@currname . \@currext }
           {
             \clist_put_right:Nv \l_@@_options_clist
-              { opt@ \@currname . \@currext }
+              { @raw at opt@ \@currname . \@currext }
           }
       }
   }
diff --git a/base/testfiles/github-0862.lvt b/base/testfiles/github-0862.lvt
new file mode 100644
index 00000000..33c462ae
--- /dev/null
+++ b/base/testfiles/github-0862.lvt
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\begin{filecontents}[force]{\jobname.sty}
+  \ProvidesPackage{\jobname}
+  \DeclareKeys{foo .code = \typeout{Foo was gives: \detokenize{#1}}}
+  \ProcessKeyOptions\relax
+\end{filecontents}
+
+\input{test2e}
+
+\START
+
+\RequirePackage[foo=\empty]{\jobname}\relax
+\RequirePackage[foo=\empty]{\jobname}\relax
+ 
+\END
diff --git a/base/testfiles/github-0109.tlg b/base/testfiles/github-0862.tlg
similarity index 54%
copy from base/testfiles/github-0109.tlg
copy to base/testfiles/github-0862.tlg
index bdde2283..3e95c492 100644
--- a/base/testfiles/github-0109.tlg
+++ b/base/testfiles/github-0862.tlg
@@ -1,7 +1,7 @@
 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
+(github-0862.sty
+Package: github-0862 
+Foo was gives: \empty 
 )
+Foo was gives: \empty 





More information about the latex3-commits mailing list.