Skip to content

Commit

Permalink
Correct option handling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jun 19, 2022
1 parent 7e69456 commit 826a4de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Expand Up @@ -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-06-18 Joseph Wright <Joseph.Wright@latex-project.org>

* ltkeys.dtx (subsection{Main mechanism})
Correct option removal logic

2022-06-16 Joseph Wright <Joseph.Wright@latex-proejct.org>

* ltkeys.dtx (subsection{Main mechanism})
Expand Down
19 changes: 10 additions & 9 deletions base/ltkeys.dtx
Expand Up @@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltkeys.dtx}
[2022/06/16 v1.0g LaTeX Kernel (Kevyal options)]
[2022/06/18 v1.0h LaTeX Kernel (Kevyal options)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{ltkeys.dtx}
Expand Down Expand Up @@ -278,8 +278,9 @@
%
% \begin{macro}{\@@_options_class:n}
% \changes{v1.0g}{2022/06/16}{Better handling of option removal}
% \begin{macro}{\@@_options_remove:nnn}
% \begin{macro}{\@@_options_remove:nnnN}
% \changes{v1.0g}{2022/06/16}{New function}
% \changes{v1.0h}{2022/06/18}{Correct option removal logic}
% 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 All @@ -299,20 +300,20 @@
{
\clist_map_inline:cn { opt@ \@currname . \@currext }
{
\@@_options_remove:enn
\@@_options_remove:ennN
{ \@@_remove_equals:n {##1} }
{##1} {#1}
{##1} {#1} \clist_put_right:Nn
}
}
}
}
\cs_new_protected:Npn \@@_options_remove:nnn #1#2#3
\cs_new_protected:Npn \@@_options_remove:nnnN #1#2#3#4
{
\keys_if_exist:nnTF {#3} {#1}
{ \clist_put_right:Nn \l_@@_options_clist {#2} }
{ \clist_put_right:Nn \@unusedoptionlist {#1} }
{ #4 \@unusedoptionlist {#1} }
}
\cs_generate_variant:Nn \@@_options_remove:nnn { e }
\cs_generate_variant:Nn \@@_options_remove:nnnN { e }
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand All @@ -328,9 +329,9 @@
{
\clist_map_inline:Nn \@classoptionslist
{
\@@_options_remove:enn
\@@_options_remove:ennN
{ \@@_remove_equals:n {##1} }
{##1} {#1}
{##1} {#1} \clist_remove_all:Nn
}
}
% \end{macrocode}
Expand Down

0 comments on commit 826a4de

Please sign in to comment.