[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/key-removal: Correct remove from \@unusedoptionlist (edd2f350)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jun 19 23:47:45 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/key-removal
Link       : https://github.com/latex3/latex2e/commit/edd2f350254e42d690cf52cea0732b52ee9ddbfc

>---------------------------------------------------------------

commit edd2f350254e42d690cf52cea0732b52ee9ddbfc
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jun 19 22:47:45 2022 +0100

    Correct remove from \@unusedoptionlist


>---------------------------------------------------------------

edd2f350254e42d690cf52cea0732b52ee9ddbfc
 base/changes.txt |  5 +++++
 base/ltkeys.dtx  | 26 +++++++++++++++++++-------
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 4ccff60e..b0e4d5df 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-19 Joseph Wright <Joseph.Wright at latex-proejct.org>
+
+	* ltkeys.dtx (subsection{Main mechanism})
+	Correct approach to removing keys from \@unusedoptionlist
+
 #########################
 # 2022-06-01 PL1 Release
 #########################
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index c6dfa5f6..ac937201 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/19 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}
-% \changes{v1.0g}{2022/06/16}{New function}
+% \changes{v1.0h}{2022/06/19}{Further work on handling of option removal}
+% \begin{macro}{\@@_options_class:nnn}
+% \changes{v1.0h}{2022/06/19}{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
@@ -299,26 +300,28 @@
           {
             \clist_map_inline:cn { opt@ \@currname . \@currext }
               {
-                \@@_options_remove:enn
+                \exp_args:Ne \@@_options_class:nnn
                   { \@@_remove_equals:n {##1} }
                   {##1} {#1}
               }
           }
       }
   }
-\cs_new_protected:Npn \@@_options_remove:nnn #1#2#3
+\cs_new_protected:Npn \@@_options_class: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}
+% \changes{v1.0h}{2022/06/19}{Further work on handling of option removal}
+% \begin{macro}{\@@_options_package:nnn}
+% \changes{v1.0h}{2022/06/19}{New function}
 %   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
@@ -328,13 +331,22 @@
   {
     \clist_map_inline:Nn \@classoptionslist
       {
-        \@@_options_remove:enn
+        \exp_args:Ne \@@_options_package:nnn
           { \@@_remove_equals:n {##1} }
           {##1} {#1}
       }
   }
+\cs_new_protected:Npn \@@_options_package:nnn #1#2#3
+  {
+    \keys_if_exist:nnT {#3} {#1}
+      {
+        \clist_put_right:Nn \l_@@_options_clist {#2}
+        \clist_remove_all:Nn \@unusedoptionlist {#1}
+      }
+   }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\@@_options_local:}
 %   If local options are found, the are added to the processing list.





More information about the latex3-commits mailing list.