[latex3-commits] [git/LaTeX3-latex3-latex2e] gh938: Correct handling of unknown option list (see #938) (b9ef9951)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Oct 20 17:36:26 CEST 2022
Repository : https://github.com/latex3/latex2e
On branch : gh938
Link : https://github.com/latex3/latex2e/commit/b9ef99511cdc22e8e2046da2b5d2ca0d41e77222
>---------------------------------------------------------------
commit b9ef99511cdc22e8e2046da2b5d2ca0d41e77222
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Oct 20 16:36:26 2022 +0100
Correct handling of unknown option list (see #938)
>---------------------------------------------------------------
b9ef99511cdc22e8e2046da2b5d2ca0d41e77222
base/changes.txt | 4 ++++
base/doc/ltnews36.tex | 7 +++++++
base/ltkeys.dtx | 14 ++++++++------
base/testfiles/github-0892.tlg | 2 ++
4 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index 6a91ae4e..357749d7 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,10 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================
+2022-10-20 Joseph Wright <Joseph.Wright at latex-project.org>
+
+ * ltkeys.dtx: Correct handling of unknown option list
+
2022-10-10 David Carlisle <David.Carlisle at latex-project.org>
* ltclass.dtx: use \protected at edef rather than \edef when expanding option lists
diff --git a/base/doc/ltnews36.tex b/base/doc/ltnews36.tex
index fbb47d56..54e06f4e 100644
--- a/base/doc/ltnews36.tex
+++ b/base/doc/ltnews36.tex
@@ -392,6 +392,13 @@ approach altogether.
%
\githubissue{921}
+\subsection{Reporting of unused global issues when using key--value processing}
+
+Using the new key--value option processor did not properly report any unused
+global options when it was used in handling class options. This has now been
+corrected.
+%
+\githubissue{938}
\section{Changes to packages in the \pkg{amsmath} category}
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index 88f9315f..de70e9e9 100644
--- a/base/ltkeys.dtx
+++ b/base/ltkeys.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltkeys.dtx}
- [2022/08/21 v1.0k LaTeX Kernel (Keyval options)]
+ [2022/10/20 v1.0l LaTeX Kernel (Keyval options)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{ltkeys.dtx}
@@ -294,6 +294,7 @@
% \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}
+% \changes{v1.0l}{2022/10/20}{Correct handling of unused option list}
% 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
@@ -323,12 +324,13 @@
\cs_new_protected:Npn \@@_options_class:nnn #1#2#3
{
\keys_if_exist:nnTF {#3} {#1}
- { \clist_put_right:Nn \l_@@_options_clist {#2} }
{
- \str_if_eq:eeF
- { \exp_not:v { @raw at opt@ \@currname . \@currext } }
- { \exp_not:V \@raw at classoptionslist }
- { \clist_put_right:Nn \@unusedoptionlist {#1} }
+ \clist_put_right:Nn \l_@@_options_clist {#2}
+ \clist_remove_all:Nn \@unusedoptionlist {#1}
+ }
+ {
+ \clist_if_in:NnF \@unusedoptionlist {#1}
+ { \clist_put_right:Nn \@unusedoptionlist {#2} }
}
}
% \end{macrocode}
diff --git a/base/testfiles/github-0892.tlg b/base/testfiles/github-0892.tlg
index 298f0ea5..d75bc03a 100644
--- a/base/testfiles/github-0892.tlg
+++ b/base/testfiles/github-0892.tlg
@@ -36,6 +36,8 @@ LaTeX has been asked to set an option called 'option5' but the package
"l3keys2e-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.
+LaTeX Warning: Unused global option(s):
+ [option2=more stuff,option3=unused].
(github-0892.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line ....
LaTeX Font Info: ... okay on input line ....
More information about the latex3-commits
mailing list.