[latex3-commits] [git/LaTeX3-latex3-latex3] options: Back to ".usage:n" (df12672ec)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Jan 10 18:19:26 CET 2022
Repository : https://github.com/latex3/latex3
On branch : options
Link : https://github.com/latex3/latex3/commit/df12672ec9b6da76486ec75a1cfeb4d86cefd97c
>---------------------------------------------------------------
commit df12672ec9b6da76486ec75a1cfeb4d86cefd97c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Jan 10 13:55:45 2022 +0000
Back to ".usage:n"
This time cleaning up properly.
>---------------------------------------------------------------
df12672ec9b6da76486ec75a1cfeb4d86cefd97c
l3kernel/l3keys.dtx | 60 ++++++++++++++++++++--------------------
l3kernel/testfiles/m3keys007.lvt | 30 ++++++++++----------
l3kernel/testfiles/m3keys007.tlg | 14 +++++-----
3 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index 767556a01..df641f514 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -679,26 +679,26 @@
% \cs{l_keys_choice_tl} and \cs{l_keys_choice_int} in exactly
% the same way as described for \texttt{.choices:nn}.
%
-% \subsection{Key validity}
+% \subsection{Key usage scope}
%
% Some keys will be used as settings which have a strictly limited scope
-% of validity. Some will be only available once, others will only be valid
+% of usage. Some will be only available once, others will only be valid
% until typesetting begins. To allow formats to support this in a structured
% way, \pkg{l3keys} allows this information to be specified using the
-% \texttt{.validity:n} property.
+% \texttt{.usage:n} property.
%
-% \begin{function}[added = 2022-01-10]{.validity:n}
+% \begin{function}[added = 2022-01-10]{.usage:n}
% \begin{syntax}
-% \meta{key} .validity:n = \meta{scope}
+% \meta{key} .usage:n = \meta{scope}
% \end{syntax}
-% Defines the \meta{key} to have validity within the \meta{scope}, which
+% Defines the \meta{key} to have usage within the \meta{scope}, which
% should be one of \texttt{general}, \texttt{preamble} or \texttt{load}.
% \end{function}
%
% \begin{variable}[added = 2022-01-10]
-% {\l_keys_validity_load_prop, \l_keys_validity_preamble_prop}
+% {\l_keys_usage_load_prop, \l_keys_usage_preamble_prop}
% \pkg{l3keys} itself does \emph{not} attempt to redefine keys based on the
-% validity scope. Rather, this information is made available with these
+% usage scope. Rather, this information is made available with these
% two property lists. These hold an entry for each module (prefix); the
% value of each entry is a comma-separated list of the usage-restricted
% key(s).
@@ -1650,11 +1650,11 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_keys_validity_load_prop, \l_keys_validity_preamble_prop}
+% \begin{variable}{\l_keys_usage_load_prop, \l_keys_usage_preamble_prop}
% Global data for document-level information.
% \begin{macrocode}
-\prop_new:N \l_keys_validity_load_prop
-\prop_new:N \l_keys_validity_preamble_prop
+\prop_new:N \l_keys_usage_load_prop
+\prop_new:N \l_keys_usage_preamble_prop
% \end{macrocode}
% \end{variable}
%
@@ -2179,57 +2179,57 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_validity:n}
-% \begin{macro}{\@@_validity:NN}
-% \begin{macro}{\@@_validity:w}
+% \begin{macro}{\@@_usage:n}
+% \begin{macro}{\@@_usage:NN}
+% \begin{macro}{\@@_usage:w}
% Save the relevant data.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_validity:n #1
+\cs_new_protected:Npn \@@_usage:n #1
{
\str_case:nnF {#1}
{
{ general }
{
- \@@_validity:NN \l_keys_validity_load_prop
+ \@@_usage:NN \l_keys_usage_load_prop
\c_false_bool
- \@@_validity:NN \l_keys_validity_preamble_prop
+ \@@_usage:NN \l_keys_usage_preamble_prop
\c_false_bool
}
{ load }
{
- \@@_validity:NN \l_keys_validity_load_prop
+ \@@_usage:NN \l_keys_usage_load_prop
\c_true_bool
- \@@_validity:NN \l_keys_validity_preamble_prop
+ \@@_usage:NN \l_keys_usage_preamble_prop
\c_false_bool
}
{ preamble }
{
- \@@_validity:NN \l_keys_validity_load_prop
+ \@@_usage:NN \l_keys_usage_load_prop
\c_false_bool
- \@@_validity:NN \l_keys_validity_preamble_prop
+ \@@_usage:NN \l_keys_usage_preamble_prop
\c_true_bool
}
}
{
\msg_error:nnnn { keys }
{ choice-unknown }
- { .validity:n }
+ { .usage:n }
{#1}
}
}
-\cs_new_protected:Npn \@@_validity:NN #1#2
+\cs_new_protected:Npn \@@_usage:NN #1#2
{
\prop_get:NVNF #1 \l_@@_module_str \l_@@_tmpa_tl
{ \tl_clear:N \l_@@_tmpa_tl }
\tl_set:Nx \l_@@_tmpb_tl
- { \exp_after:wN \@@_validity:w \l_keys_path_str \s_@@_stop }
+ { \exp_after:wN \@@_usage:w \l_keys_path_str \s_@@_stop }
\bool_if:NTF #2
{ \clist_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl }
{ \clist_remove_all:NV \l_@@_tmpa_tl \l_@@_tmpb_tl }
\prop_put:NVV #1 \l_@@_module_str
\l_@@_tmpa_tl
}
-\cs_new:Npn \@@_validity:w #1 / #2 \s_@@_stop {#2}
+\cs_new:Npn \@@_usage:w #1 / #2 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2636,10 +2636,10 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{.validity:n}
+% \begin{macro}{.usage:n}
% \begin{macrocode}
-\cs_new_protected:cpn { \c_@@_props_root_str .validity:n } #1
- { \@@_validity:n {#1} }
+\cs_new_protected:cpn { \c_@@_props_root_str .usage:n } #1
+ { \@@_usage:n {#1} }
% \end{macrocode}
% \end{macro}
%
@@ -2657,7 +2657,7 @@
%
% \subsection{Key properties for \LaTeXe{} options}
%
-% \begin{macro}{.if, .store, .validity}
+% \begin{macro}{.if, .store, .usage}
% \begin{macrocode}
\group_begin:
\cs_set_protected:Npn \@@_tmp:nn #1#2
@@ -2671,7 +2671,7 @@
\@@_tmp:nn
{ legacy_if:n } { if }
{ tl_set:N } { store }
- { validity:n } { validity }
+ { usage:n } { usage }
{ \q_recursion_tail } { }
\q_recursion_stop
\group_end:
diff --git a/l3kernel/testfiles/m3keys007.lvt b/l3kernel/testfiles/m3keys007.lvt
index bd9642c13..efa32b3e4 100644
--- a/l3kernel/testfiles/m3keys007.lvt
+++ b/l3kernel/testfiles/m3keys007.lvt
@@ -17,21 +17,21 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST { .validity:n ~ basics }
+\TEST { .usage:n ~ basics }
{
\keys_define:nn { module }
{
key-one .code:n = #1 ,
- key-one .validity:n = load ,
+ key-one .usage:n = load ,
key-two .code:n = #1 ,
- key-two .validity:n = preamble ,
+ key-two .usage:n = preamble ,
key-three .code:n = #1 ,
- key-three .validity:n = general ,
+ key-three .usage:n = general ,
key-four .code:n = #1 ,
- key-four .validity:n = oops
+ key-four .usage:n = oops
}
- \prop_show:N \l_keys_validity_load_prop
- \prop_show:N \l_keys_validity_preamble_prop
+ \prop_show:N \l_keys_usage_load_prop
+ \prop_show:N \l_keys_usage_preamble_prop
}
\TEST { .usage:n ~ adding ~ and ~ removing }
@@ -39,18 +39,18 @@
\keys_define:nn { module }
{
key-one .code:n = #1 ,
- key-one .validity:n = load ,
+ key-one .usage:n = load ,
key-two .code:n = #1 ,
- key-two .validity:n = load ,
+ key-two .usage:n = load ,
key-three .code:n = #1 ,
- key-three .validity:n = load ,
- key-three .validity:n = preamble ,
+ key-three .usage:n = load ,
+ key-three .usage:n = preamble ,
key-four .code:n = #1 ,
- key-four .validity:n = load ,
- key-four .validity:n = general
+ key-four .usage:n = load ,
+ key-four .usage:n = general
}
- \prop_show:N \l_keys_validity_load_prop
- \prop_show:N \l_keys_validity_preamble_prop
+ \prop_show:N \l_keys_usage_load_prop
+ \prop_show:N \l_keys_usage_preamble_prop
}
\END
diff --git a/l3kernel/testfiles/m3keys007.tlg b/l3kernel/testfiles/m3keys007.tlg
index 8b80befae..a0f91975f 100644
--- a/l3kernel/testfiles/m3keys007.tlg
+++ b/l3kernel/testfiles/m3keys007.tlg
@@ -2,24 +2,24 @@ This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Joseph Wright
============================================================
-TEST 1: .validity:n basics
+TEST 1: .usage:n basics
============================================================
Defining key module/key-one on line ...
Defining key module/key-two on line ...
Defining key module/key-three on line ...
Defining key module/key-four on line ...
-! LaTeX3 Error: Key '.validity:n' accepts only a fixed set of choices.
+! LaTeX3 Error: Key '.usage:n' accepts only a fixed set of choices.
For immediate help type H <return>.
...
l. ... }
-The key '.validity:n' only accepts predefined values, and 'oops' is not one of
+The key '.usage:n' only accepts predefined values, and 'oops' is not one of
these.
-The property list \l_keys_validity_load_prop contains the pairs (without outer
+The property list \l_keys_usage_load_prop contains the pairs (without outer
braces):
> {module} => {key-one}.
<recently read> }
l. ... }
-The property list \l_keys_validity_preamble_prop contains the pairs (without
+The property list \l_keys_usage_preamble_prop contains the pairs (without
outer braces):
> {module} => {key-two}.
<recently read> }
@@ -32,12 +32,12 @@ Defining key module/key-one on line ...
Defining key module/key-two on line ...
Defining key module/key-three on line ...
Defining key module/key-four on line ...
-The property list \l_keys_validity_load_prop contains the pairs (without outer
+The property list \l_keys_usage_load_prop contains the pairs (without outer
braces):
> {module} => {key-one,key-two}.
<recently read> }
l. ... }
-The property list \l_keys_validity_preamble_prop contains the pairs (without
+The property list \l_keys_usage_preamble_prop contains the pairs (without
outer braces):
> {module} => {key-three}.
<recently read> }
More information about the latex3-commits
mailing list.