[latex3-commits] [latex3/latex3] gh940-keys-meta: Respect key filtering/grouping in meta keys (fixes #940) (b0a3018b4)

github at latex-project.org github at latex-project.org
Fri May 19 14:29:09 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : gh940-keys-meta
Link       : https://github.com/latex3/latex3/commit/b0a3018b453ca5fb6b61c0011c4bcd0ec0f9fd29

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

commit b0a3018b453ca5fb6b61c0011c4bcd0ec0f9fd29
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri May 19 13:22:52 2023 +0100

    Respect key filtering/grouping in meta keys (fixes #940)


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

b0a3018b453ca5fb6b61c0011c4bcd0ec0f9fd29
 l3kernel/CHANGELOG.md            |  1 +
 l3kernel/l3keys.dtx              |  6 ++++--
 l3kernel/testfiles/m3keys004.lvt | 25 ++++++++++++++++++++++++-
 l3kernel/testfiles/m3keys004.tlg | 24 +++++++++++++++++++-----
 4 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 7bdee565c..44e4b828a 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -20,6 +20,7 @@ this project uses date-based 'snapshot' version identifiers.
 ### Fixed
 - Omit `0123456789` from URL escaping (issue \#838)
 - Leave implicit chars unchanged in `\text_expand:n` (fixes \#874)
+- Filtering/grouping applied to meta keys (issue \#940)
 - Handling of implicit chars in `\text_purify:n` (fixes \#1208)
 
 ## [2023-05-15]
diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index 64a301d90..654f85c0c 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -2112,13 +2112,15 @@
 %
 % \begin{macro}{\@@_meta_make:n}
 % \begin{macro}{\@@_meta_make:nn}
-%   To create a meta-key, simply set up to pass data through.
+%   To create a meta-key, simply set up to pass data through. The internal
+%   function is used here as a meta key should respect the prevailing
+%   filtering, etc.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_meta_make:n #1
   {
     \exp_args:NVo \@@_cmd_set_direct:nn \l_keys_path_str
       {
-        \exp_after:wN \keys_set:nn \exp_after:wN 
+        \exp_after:wN \@@_set:nn \exp_after:wN 
           { \l_@@_module_str } {#1}
       }
   }
diff --git a/l3kernel/testfiles/m3keys004.lvt b/l3kernel/testfiles/m3keys004.lvt
index 45d333871..d251bd09b 100644
--- a/l3kernel/testfiles/m3keys004.lvt
+++ b/l3kernel/testfiles/m3keys004.lvt
@@ -1,4 +1,4 @@
-% Copyright (C) 2013-2015,2018-2021 The LaTeX Project
+% Copyright (C) 2013-2015,2018-2021,2023 The LaTeX Project
 
 
 \documentclass{minimal}
@@ -247,6 +247,29 @@
       }
   }
 
+\TEST { Grouping~meta~keys }
+  {
+    \OMIT
+      \keys_define:nn { }
+        {
+          A1 .code:n     = \TYPE { A1 } ,
+          A1 .groups:n   = init ,
+          A2 .code:n     = \TYPE { A2 } ,
+          A2 .groups:n   = init ,
+          B1 .code:n     = \TYPE { B1 } ,
+          B1 .groups:n   = main ,
+          B2 .code:n     = \TYPE { B2 } ,
+          B2 .groups:n   = main ,
+          meta .meta:n   = { B1 , A2 } ,
+          meta .groups:n = { init , main }
+        }
+    \TIMO
+    \keys_set_groups:nnn { } { init } { B1 , A1 , A2 , B2 }
+    \keys_set_groups:nnn { } { main } { B1 , A1 , A2 , B2 }
+    \keys_set_groups:nnn { } { init } { meta , B1 , A1 , A2 , B2 }
+    \keys_set_groups:nnn { } { main } { meta , B1 , A1 , A2 , B2 }
+  }
+
 \TEST { Nesting ~ setting }
   {
     \OMIT
diff --git a/l3kernel/testfiles/m3keys004.tlg b/l3kernel/testfiles/m3keys004.tlg
index 9d27821f9..d895f2905 100644
--- a/l3kernel/testfiles/m3keys004.tlg
+++ b/l3kernel/testfiles/m3keys004.tlg
@@ -149,7 +149,21 @@ Defining key module/key-four on line ...
 "other-value"
 ============================================================
 ============================================================
-TEST 8: Nesting setting
+TEST 8: Grouping meta keys
+============================================================
+A1
+A2
+B1
+B2
+A2
+A1
+A2
+B1
+B1
+B2
+============================================================
+============================================================
+TEST 9: Nesting setting
 ============================================================
 ! LaTeX Error: The key 'empty-module/key-two' is unknown and is being ignored.
 For immediate help type H <return>.
@@ -163,7 +177,7 @@ The comma list \l_tmpa_clist is empty
 l. ...  }
 ============================================================
 ============================================================
-TEST 9: \keys_if_exist:nnTF 
+TEST 10: \keys_if_exist:nnTF 
 ============================================================
 TRUE
 FALSE
@@ -171,7 +185,7 @@ TRUE
 FALSE
 ============================================================
 ============================================================
-TEST 10: \keys_if_choice_exist:nnnTF 
+TEST 11: \keys_if_choice_exist:nnnTF 
 ============================================================
 TRUE
 FALSE
@@ -183,7 +197,7 @@ FALSE
 FALSE
 ============================================================
 ============================================================
-TEST 11: \keys_show:nn 
+TEST 12: \keys_show:nn 
 ============================================================
 The key module/key-one has the properties:
 >  code  =>  \TYPE {"#1"}.
@@ -203,7 +217,7 @@ The key module-a/key-one is undefined.
 l. ...  }
 ============================================================
 ============================================================
-TEST 12: Undefined error in code
+TEST 13: Undefined error in code
 ============================================================
 ! Undefined control sequence.
 <argument> \undefinedA 





More information about the latex3-commits mailing list.