diff options
Diffstat (limited to 'macros/latex/base/ltkeys.dtx')
-rw-r--r-- | macros/latex/base/ltkeys.dtx | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/macros/latex/base/ltkeys.dtx b/macros/latex/base/ltkeys.dtx index 00c2600289..c6dfa5f6dd 100644 --- a/macros/latex/base/ltkeys.dtx +++ b/macros/latex/base/ltkeys.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltkeys.dtx} - [2022/02/21 v1.0f LaTeX Kernel (Kevyal options)] + [2022/06/16 v1.0g LaTeX Kernel (Kevyal options)] % \iffalse \documentclass{l3doc} \GetFileInfo{ltkeys.dtx} @@ -277,6 +277,9 @@ % \end{macro} % % \begin{macro}{\@@_options_class:n} +% \changes{v1.0g}{2022/06/16}{Better handling of option removal} +% \begin{macro}{\@@_options_remove:nnn} +% \changes{v1.0g}{2022/06/16}{New function} % 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 @@ -296,18 +299,26 @@ { \clist_map_inline:cn { opt@ \@currname . \@currext } { - \keys_if_exist:neTF - {#1} { \@@_remove_equals:n {##1} } - { \clist_put_right:Nn \l_@@_options_clist {##1} } - { \clist_put_right:Nn \@unusedoptionlist {##1} } + \@@_options_remove:enn + { \@@_remove_equals:n {##1} } + {##1} {#1} } } } } +\cs_new_protected:Npn \@@_options_remove:nnn #1#2#3 + { + \keys_if_exist:nnTF {#3} {#1} + { \clist_put_right:Nn \l_@@_options_clist {#2} } + { \clist_put_right:Nn \@unusedoptionlist {#1} } + } +\cs_generate_variant:Nn \@@_options_remove:nnn { e } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\@@_options_package:n} +% \changes{v1.0g}{2022/06/16}{Better handling of option removal} % For global options when processing a package, the tasks are slightly % different from those for a class. The check is the same, but here % there is nothing to do if the option is not applicable. Each valid @@ -317,11 +328,9 @@ { \clist_map_inline:Nn \@classoptionslist { - \keys_if_exist:neT {#1} { \@@_remove_equals:n {##1} } - { - \clist_put_right:Nn \l_@@_options_clist {##1} - \clist_remove_all:Nn \@unusedoptionlist {##1} - } + \@@_options_remove:enn + { \@@_remove_equals:n {##1} } + {##1} {#1} } } % \end{macrocode} |