Skip to content

Commit

Permalink
Correct handling of unknown option list (see #938)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Oct 20, 2022
1 parent 88fed6c commit b9ef995
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions base/changes.txt
Expand Up @@ -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@latex-project.org>

* ltkeys.dtx: Correct handling of unknown option list

2022-10-10 David Carlisle <David.Carlisle@latex-project.org>

* ltclass.dtx: use \protected@edef rather than \edef when expanding option lists
Expand Down
7 changes: 7 additions & 0 deletions base/doc/ltnews36.tex
Expand Up @@ -392,6 +392,13 @@ \subsection{Resolve an issue with \cs{mathchoice} and \texttt{localalphabets}}
%
\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}

Expand Down
14 changes: 8 additions & 6 deletions base/ltkeys.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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@opt@ \@currname . \@currext } }
{ \exp_not:V \@raw@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}
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/github-0892.tlg
Expand Up @@ -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 ....
Expand Down

0 comments on commit b9ef995

Please sign in to comment.