From 826a4de3b6e7077d05db0c2a579458039250241d Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Sun, 19 Jun 2022 08:37:06 +0100 Subject: [PATCH] Correct option handling logic --- base/changes.txt | 5 +++++ base/ltkeys.dtx | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/base/changes.txt b/base/changes.txt index ce72312d3..2e0f54432 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-06-18 Joseph Wright + + * ltkeys.dtx (subsection{Main mechanism}) + Correct option removal logic + 2022-06-16 Joseph Wright * ltkeys.dtx (subsection{Main mechanism}) diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx index c6dfa5f6d..4b6ebb8c6 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/18 v1.0h LaTeX Kernel (Kevyal options)] % \iffalse \documentclass{l3doc} \GetFileInfo{ltkeys.dtx} @@ -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 @@ -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} @@ -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}