[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/removeopts2: Correct option handling logic (826a4de3)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jun 19 09:37:06 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/removeopts2
Link       : https://github.com/latex3/latex2e/commit/826a4de3b6e7077d05db0c2a579458039250241d

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

commit 826a4de3b6e7077d05db0c2a579458039250241d
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jun 19 08:37:06 2022 +0100

    Correct option handling logic


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

826a4de3b6e7077d05db0c2a579458039250241d
 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 ce72312d..2e0f5443 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 <Joseph.Wright at latex-project.org>
+
+	* ltkeys.dtx (subsection{Main mechanism})
+	Correct option removal logic
+
 2022-06-16  Joseph Wright <Joseph.Wright at latex-proejct.org>
 
 	* ltkeys.dtx (subsection{Main mechanism})
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index c6dfa5f6..4b6ebb8c 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}





More information about the latex3-commits mailing list.