[latex3-commits] [git/LaTeX3-latex3-latex2e] keyval-tuneup: Define key option handler in ltkeys (223b27d0)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Oct 23 19:32:04 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : keyval-tuneup
Link       : https://github.com/latex3/latex2e/commit/223b27d0784a33bb297408718faf2aaf64c17ce3

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

commit 223b27d0784a33bb297408718faf2aaf64c17ce3
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Oct 23 18:31:59 2022 +0100

    Define key option handler in ltkeys


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

223b27d0784a33bb297408718faf2aaf64c17ce3
 base/changes.txt | 4 +++-
 base/ltclass.dtx | 8 ++++----
 base/ltkeys.dtx  | 5 ++++-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 22e9db84..eb52d03e 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -18,7 +18,9 @@ are not part of the distribution.
 
 2022-10-20  Joseph Wright  <Joseph.Wright at latex-project.org>
 
-	* ltkeys.dtx: Correct an argument for a message
+	* ltclass.dtx, ltkeys.dtx:
+	Correct an argument for a message
+	Define key option handler in ltkeys
 
 2022-10-10  David Carlisle  <David.Carlisle at latex-project.org>
 
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index 8d946a32..a525b6f5 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -2186,13 +2186,15 @@
 %    \end{macrocode}
 % \changes{v1.5b}{2022/03/18}{Switch to \cs{ProcessKeyOptions}}
 % \changes{v1.5c}{2022/06/20}{Pass raw options to \cs{ProcessKeyOptions}}
+% \changes{v1.5e}{2022/10/20}
+%         {Define key option handler in \pkg{ltkeys}}
 %    In the current preferred approach, a key family name will exist for
 %    processing using \pkg{ltkeys}. In that case, we replace the previous
 %    package options with the new ones, then call the key handler.
 %    Otherwise, we use the more classical clash handler.
 %    \begin{macrocode}
     {%
-      \@ifundefined{opt at fam@\@currname.\@currext}
+      \@ifundefined{opt at handler@\@currname.\@currext}
         {\@onefilewithoptions at clashchk{#2}}
         {%
 %    \end{macrocode}
@@ -2201,9 +2203,7 @@
           \expandafter\protected at edef\csname opt@\@currname.\@currext\endcsname
             {\zap at space#2 \@empty}%
           \@namedef{@raw at opt@\@currname.\@currext}{#2}%
-          \expandafter\expandafter\expandafter\ProcessKeyOptions
-            \expandafter\expandafter\expandafter
-              [\csname opt at fam@\@currname.\@currext\endcsname]%
+          \@nameuse{opt at handler@\@currname.\@currext}%
         }%
     }%
     {\makeatletter
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index b57cad1c..edf12f7c 100644
--- a/base/ltkeys.dtx
+++ b/base/ltkeys.dtx
@@ -209,6 +209,8 @@
 % \begin{macro}{\@@_options_aux:n}
 % \changes{v1.0b}{2022/01/15}
 %         {Clear option list in end-of-package hook}
+% \changes{v1.0l}{2022/10/20}
+%         {Define key option handler in \pkg{ltkeys}}
 % \changes{v1.0i}{2022/07/05}{Support \cs{CurrentOption}}
 % \begin{macro}{\@@_options_end:}
 %   The main function calls functions to collect up the global and local
@@ -225,7 +227,8 @@
   { \@@_options_expand_module:Nn \@@_options_aux:n {#1} }
 \cs_new_protected:Npn \@@_options_aux:n #1
   {
-    \cs_gset_nopar:cpn { opt at fam@\@currname.\@currext } {#1}
+    \cs_gset_protected:cpn { opt at handler@\@currname.\@currext }
+      { \ProcessKeyOptions [ #1 ] }
     \cs_set_protected:Npn \@@_option_end: { }
     \clist_clear:N \l_@@_options_clist
     \@@_options_global:n {#1}





More information about the latex3-commits mailing list.