[latex3-commits] [git/LaTeX3-latex3-latex3] options: Data for load-time keys needs to be subdivided (e62994879)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Nov 26 09:06:28 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : options
Link       : https://github.com/latex3/latex3/commit/e6299487924a3f8c6c79e602f5a1982e3c9e5273

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

commit e6299487924a3f8c6c79e602f5a1982e3c9e5273
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Nov 26 08:06:28 2021 +0000

    Data for load-time keys needs to be subdivided
    
    I wonder if the seq/clist split here is useful: better to
    make everything clists? Or make both props?


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

e6299487924a3f8c6c79e602f5a1982e3c9e5273
 l3kernel/l3keys.dtx | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index 8360f7881..0dfb1cf48 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -695,10 +695,12 @@
 %   should be one of \texttt{general}, \texttt{preamble} or \texttt{load-time}.
 % \end{function}
 %
-% \begin{variable}{\g_keys_load_time_seq, \g_keys_preamble_seq}
+% \begin{variable}{\g_keys_load_time_prop, \g_keys_preamble_seq}
 %   \pkg{l3keys} itself does \emph{not} attempt to redefine keys based on the
 %   validity scope. Rather, this information is made available with these
-%   sequences. Each entry will be a full key path, which can therefore
+%   two variables. The property list holds an entry for each module (prefix).
+%   Each of these entries, and the sequence of preamble-only keys, comprise
+%   a set of fully-qualified key paths. This data can therefore
 %   be used to disable each key when it is out-of-scope. 
 % \end{variable}
 %
@@ -1648,10 +1650,10 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\g_keys_load_time_seq, \g_keys_preamble_seq}
+% \begin{variable}{\g_keys_load_time_prop, \g_keys_preamble_seq}
 %   Global data for document-level information.
 %    \begin{macrocode}
-\seq_new:N \g_keys_load_time_seq
+\prop_new:N \g_keys_load_time_prop
 \seq_new:N \g_keys_preamble_seq
 %    \end{macrocode}
 % \end{variable}
@@ -2178,6 +2180,7 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_validity:n}
+% \begin{macro}{\@@_validity_aux:n}
 %   Save the relevant data.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_validity:n #1
@@ -2186,19 +2189,21 @@
       {
         { general }
           {
-            \seq_gremove:NV \g_keys_load_time_seq \l_keys_path_str
+            \@@_validity_aux:n
+              { \clist_remove:NV \l_@@_tmpa_tl \l_keys_path_str }
             \seq_gremove:NV \g_keys_preamble_seq \l_keys_path_str
           }
         { load-time }
           {
-            \seq_gput:NV \g_keys_load_time_seq \l_keys_path_str
+            \@@_validity_aux:n
+              { \clist_put_right:NV \l_@@_tmpa_tl \l_keys_path_str }
             \seq_gremove:NV \g_keys_preamble_seq \l_keys_path_str
           }
         { preamble }
           {
-            \seq_gremove:NV \g_keys_load_time_seq \l_keys_path_str
+            \@@_validity_aux:n
+              { \clist_remove:NV \l_@@_tmpa_tl \l_keys_path_str }
             \seq_gput:NV \g_keys_preamble_seq \l_keys_path_str
-
           }
       }
       {
@@ -2207,8 +2212,18 @@
           { .validity:n }
       }
   }
+\cs_new_protected:Npn \@@_validity_aux:n #1
+  {
+    \prop_get:NVNF \g_keys_load_time_prop \l_@@_module_str
+      \l_@@_tmpa_tl
+      { \tl_clear:N \l_@@_tmpa_tl }
+    
+    \prop_gput:NVV \g_keys_load_time_prop \l_@@_module_str
+      \l_@@_tmpa_tl
+  }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\@@_variable_set:NnnN, \@@_variable_set:cnnN}
 % \begin{macro}{\@@_variable_set_required:NnnN, \@@_variable_set_required:cnnN}





More information about the latex3-commits mailing list.