Skip to content

Commit

Permalink
Merge branch 'hotfix/removekey' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jun 16, 2022
2 parents 8dc0064 + 8c8f2a5 commit aea570f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
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-16 Joseph Wright <[email protected]>

* ltkeys.dtx (subsection{Main mechanism})
Remove key name but avoid touching key value in \@unusedoptionlist

2022-06-15 Frank Mittelbach <[email protected]>

* lthooks.dtx (subsubsection{Disabling and providing hooks}):
Expand Down
29 changes: 19 additions & 10 deletions base/ltkeys.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit aea570f

Please sign in to comment.