[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh892: Correct name for raw class option list storage (4663fd87)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Jul 5 10:49:41 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh892
Link       : https://github.com/latex3/latex2e/commit/4663fd8763ae8bc2ddc78d0569b956942872ea07

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

commit 4663fd8763ae8bc2ddc78d0569b956942872ea07
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Jul 5 09:49:41 2022 +0100

    Correct name for raw class option list storage


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

4663fd8763ae8bc2ddc78d0569b956942872ea07
 base/changes.txt                                   |  5 +++
 base/ltkeys.dtx                                    |  5 ++-
 base/testfiles/github-0892.lvt                     | 45 ++++++++++++++++++++++
 .../testfiles/{github-0414.tlg => github-0892.tlg} | 28 +++++++++++---
 4 files changed, 75 insertions(+), 8 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index eeb9833e..9e8b08b0 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,11 @@ are not part of the distribution.
 All changes above are only part of the development branch for the next release.
 ================================================================================
 
+2022-07-05  Joseph Wright <Joseph.Wright at latex-project.org>
+
+	* ltkeys.dtx (subsection{Main mechanism})
+	Correct name of store for raw class options list
+
 #########################
 # 2022-06-01 PL4 Release
 ########################
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index fbd5ce30..33c08100 100644
--- a/base/ltkeys.dtx
+++ b/base/ltkeys.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltkeys.dtx}
-             [2022/06/20 v1.0h LaTeX Kernel (Kevyal options)]
+             [2022/07/05 v1.0i LaTeX Kernel (Kevyal options)]
 % \iffalse
 \documentclass{l3doc}
 \GetFileInfo{ltkeys.dtx}
@@ -283,6 +283,7 @@
 % \changes{v1.0h}{2022/06/20}{Use raw options data}
 % \begin{macro}{\@@_options_class:nnn}
 % \changes{v1.0h}{2022/06/20}{New function}
+% \changes{v1.0i}{2022/07/05}{Correct naming of raw class options storage}
 %   For classes, each option (stripped of any content after |=|)
 %   is checked for existence as a key. If found, the option is added to
 %   the combined list for processing. On the other hand, unused options
@@ -316,7 +317,7 @@
       {
         \str_if_eq:eeF
           { \exp_not:v { @raw at opt@ \@currname . \@currext } }
-          { \exp_not:V \@raw at classoption }
+          { \exp_not:V \@raw at classoptionslist }
           { \clist_put_right:Nn \@unusedoptionlist {#1} }
       }
   }
diff --git a/base/testfiles/github-0892.lvt b/base/testfiles/github-0892.lvt
new file mode 100644
index 00000000..4eec10f3
--- /dev/null
+++ b/base/testfiles/github-0892.lvt
@@ -0,0 +1,45 @@
+\begin{filecontents}{l3keys2e-class.cls}
+  \LoadClass{article}
+ %% \RequirePackage{l3keys2e}
+  \ProvidesExplClass{l3keys2e-class}{0000/00/00}{0.0}{test}
+  \DeclareKeys {
+    option1 .code:n = {\wlog{You~gave~`#1'~for~option1}}
+  }
+  \ProcessKeyOptions
+\end{filecontents}
+
+\input{test2e}
+
+\START
+
+% Load the class with some options.
+% The class itself recognises `option1', leaving `option2' and
+% `option3' as global optons which are not yet used.
+\documentclass[option1=check,option2=more stuff,option3=unused]
+  {l3keys2e-class}
+
+%Now create a package
+\begin{filecontents}{l3keys2e-package.sty}
+%%   \RequirePackage{l3keys2e}
+  \ProvidesExplPackage{l3keys2e-package}{0000/00/00}{0.0}{test}
+  \DeclareKeys {
+    option1 .code:n = {\wlog{You~gave~`#1'~for~option1~(again)}},
+    option2 .code:n = {\wlog{You~gave~`#1'~for~option2}},
+    option4 .code:n = {\wlog{You~gave~`#1'~for~option4}},
+  }
+  \ProcessKeyOptions
+\end{filecontents}
+
+% Load the package.
+\usepackage[option4={extra stuff},option5=undefined!]
+  {l3keys2e-package}\START
+
+\begin{document}
+
+\END
+
+
+% The log should show that option3 is an unused global option, and that
+% option5 is not known by the l3keys2e-demo package. Everything else
+% should simply be listed in the log.
+\end{document}
\ No newline at end of file
diff --git a/base/testfiles/github-0414.tlg b/base/testfiles/github-0892.tlg
similarity index 60%
copy from base/testfiles/github-0414.tlg
copy to base/testfiles/github-0892.tlg
index 455107c4..566c2522 100644
--- a/base/testfiles/github-0414.tlg
+++ b/base/testfiles/github-0892.tlg
@@ -1,6 +1,6 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-(testpath//testcls.cls (article.cls
+(l3keys2e-class.cls (article.cls
 Document Class: article ....-..-.. v... Standard LaTeX document class
 (size10.clo
 File: size10.clo ....-..-.. v... Standard LaTeX file (size option)
@@ -17,8 +17,27 @@ File: size10.clo ....-..-.. v... Standard LaTeX file (size option)
 \belowcaptionskip=\skip...
 \bibindent=\dimen...
 )
-Look at me, I'm loading 'array.sty'
-) (github-0414.aux)
+Document Class: l3keys2e-class ....-..-.. v... test
+)
+You gave `check' for option1
+LaTeX Info: File `l3keys2e-package.sty' already exists on the system.
+            Not generating it from this source.
+(l3keys2e-package.sty
+Package: l3keys2e-package ....-..-.. v... test
+)
+You gave `check' for option1 (again)
+You gave `more stuff' for option2
+You gave `extra stuff' for option4
+! LaTeX3 Error: Unknown option 'option5' for package l3keys2e-package.
+For immediate help type H <return>.
+ ...                                              
+l. ...  {l3keys2e-package}\START
+                               ^^M
+LaTeX has been asked to set an option called 'option5' but the
+l3keys2e-package package has not created an option with this name.
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+(github-0892.aux)
 LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line ....
 LaTeX Font Info:    ... okay on input line ....
 LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line ....
@@ -33,6 +52,3 @@ LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line ....
 LaTeX Font Info:    ... okay on input line ....
 LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line ....
 LaTeX Font Info:    ... okay on input line ....
-Right: macro:->array
-Wrong: \relax
-(github-0414.aux)





More information about the latex3-commits mailing list.