[latex3-commits] [git/LaTeX3-latex3-latex3] main: Support global template keys (d8791d246)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed May 25 22:15:54 CEST 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/d8791d24691cb1d93faabcfd54b551e3bf992e9c

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

commit d8791d24691cb1d93faabcfd54b551e3bf992e9c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed May 25 21:15:54 2022 +0100

    Support global template keys


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

d8791d24691cb1d93faabcfd54b551e3bf992e9c
 l3packages/xtemplate/xtemplate.dtx | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/l3packages/xtemplate/xtemplate.dtx b/l3packages/xtemplate/xtemplate.dtx
index f10f7b409..6605e277b 100644
--- a/l3packages/xtemplate/xtemplate.dtx
+++ b/l3packages/xtemplate/xtemplate.dtx
@@ -1618,7 +1618,8 @@
             \keys_define:nx { template / #1 }
               {
                 \l_@@_key_name_tl
-                  .cs_set_protected:Np = \exp_not:N #3
+                  .cs_ \str_if_eq:nnT {#1} { global } { g }
+                     set_protected:Np = \exp_not:N #3
               }
             \prop_put:Non \l_@@_vars_prop
               \l_@@_key_name_tl {#2#3}
@@ -1630,7 +1631,12 @@
             \keys_define:nx { template / #1 }
               {
                 \l_@@_key_name_tl
-                  .cs_set_protected:Np = \exp_not:N #3
+                  .code:n =
+                    {
+                      \exp_not:c
+                        { cs_ \str_if_eq:nnT {#1} { global } { g } seq_eq:NN }
+                        \exp_not:N #3 ####1
+                    }
               }
             \prop_put:Non \l_@@_vars_prop
               \l_@@_key_name_tl {#2#3}
@@ -1640,7 +1646,12 @@
             \keys_define:nx { template / #1 }
               {
                 \l_@@_key_name_tl
-                  .code = { \cs_set:Npn \exp_not:N #3 { \UseInstance {##1} } }
+                  .code:n =
+                    {
+                      \exp_not:c
+                        { cs_ \str_if_eq:nnT {#1} { global } { g } set:Npn }
+                        \exp_not:N #3 { \UseInstance {####1} }
+                    }
               }
             \prop_put:Non \l_@@_vars_prop
               \l_@@_key_name_tl {#2#3}





More information about the latex3-commits mailing list.