[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/removekey: Only remove key name from \@unusedoptionlist (e02de643)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Jun 16 08:23:33 CEST 2022
Repository : https://github.com/latex3/latex2e
On branch : hotfix/removekey
Link : https://github.com/latex3/latex2e/commit/e02de6430024f92c0ca402eb417712188f145b93
>---------------------------------------------------------------
commit e02de6430024f92c0ca402eb417712188f145b93
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Jun 16 07:23:33 2022 +0100
Only remove key name from \@unusedoptionlist
>---------------------------------------------------------------
e02de6430024f92c0ca402eb417712188f145b93
base/changes.txt | 5 +++++
base/ltkeys.dtx | 29 +++++++++++++++++++----------
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index becab75e..ce72312d 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-16 Joseph Wright <Joseph.Wright at latex-proejct.org>
+
+ * ltkeys.dtx (subsection{Main mechanism})
+ Remove key name but avoid touching key value in \@unusedoptionlist
+
2022-06-15 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
* lthooks.dtx (subsubsection{Disabling and providing hooks}):
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index 00c26002..b54a1d37 100644
--- a/base/ltkeys.dtx
+++ b/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:xnn
+ { \@@_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_@@_latexe_options_clist {#2} }
+ { \clist_put_right:Nn \@unusedoptionlist {#1} }
+ }
+\cs_generate_variant:Nn \@@_options_remove:nnn { x }
% \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:xnn
+ { \@@_remove_equals:n {##1} }
+ {##1} {#1}
}
}
% \end{macrocode}
More information about the latex3-commits
mailing list.