[latex3-commits] [git/LaTeX3-latex3-latex3] options: Go with ".validity:n" (03c43b1c9)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Jan 10 14:23:32 CET 2022
Repository : https://github.com/latex3/latex3
On branch : options
Link : https://github.com/latex3/latex3/commit/03c43b1c96f6d1de809196f835deab36c6229ce5
>---------------------------------------------------------------
commit 03c43b1c96f6d1de809196f835deab36c6229ce5
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Jan 10 13:23:32 2022 +0000
Go with ".validity:n"
>---------------------------------------------------------------
03c43b1c96f6d1de809196f835deab36c6229ce5
l3kernel/l3keys.dtx | 50 ++++++++++++++++++++--------------------
l3kernel/testfiles/m3keys007.lvt | 30 ++++++++++++------------
l3kernel/testfiles/m3keys007.tlg | 14 +++++------
3 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index 65164863b..819db1757 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -687,16 +687,16 @@
% way, \pkg{l3keys} allows this information to be specified using the
% \texttt{.validity:n} property.
%
-% \begin{function}[added = 2021-11-26]{.usage:n}
+% \begin{function}[added = 2022-01-10]{.validity:n}
% \begin{syntax}
-% \meta{key} .usage:n = \meta{scope}
+% \meta{key} .validity:n = \meta{scope}
% \end{syntax}
% 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 = 2021-11-29]
-% {\l_keys_usage_load_prop, \l_keys_usage_preamble_prop}
+% \begin{variable}[added = 2022-01-10]
+% {\l_keys_validity_load_prop, \l_keys_validity_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
% two property lists. These hold an entry for each module (prefix); the
@@ -1650,11 +1650,11 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_keys_usage_load_prop, \l_keys_usage_preamble_prop}
+% \begin{variable}{\l_keys_validity_load_prop, \l_keys_validity_preamble_prop}
% Global data for document-level information.
% \begin{macrocode}
-\prop_new:N \l_keys_usage_load_prop
-\prop_new:N \l_keys_usage_preamble_prop
+\prop_new:N \l_keys_validity_load_prop
+\prop_new:N \l_keys_validity_preamble_prop
% \end{macrocode}
% \end{variable}
%
@@ -2179,57 +2179,57 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_usage:n}
-% \begin{macro}{\@@_usage:NN}
-% \begin{macro}{\@@_usage:w}
+% \begin{macro}{\@@_validity:n}
+% \begin{macro}{\@@_validity:NN}
+% \begin{macro}{\@@_validity:w}
% Save the relevant data.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_usage:n #1
+\cs_new_protected:Npn \@@_validity:n #1
{
\str_case:nnF {#1}
{
{ general }
{
- \@@_usage:NN \l_keys_usage_load_prop
+ \@@_validity:NN \l_keys_validity_load_prop
\c_false_bool
- \@@_usage:NN \l_keys_usage_preamble_prop
+ \@@_validity:NN \l_keys_validity_preamble_prop
\c_false_bool
}
{ load }
{
- \@@_usage:NN \l_keys_usage_load_prop
+ \@@_validity:NN \l_keys_validity_load_prop
\c_true_bool
- \@@_usage:NN \l_keys_usage_preamble_prop
+ \@@_validity:NN \l_keys_validity_preamble_prop
\c_false_bool
}
{ preamble }
{
- \@@_usage:NN \l_keys_usage_load_prop
+ \@@_validity:NN \l_keys_validity_load_prop
\c_false_bool
- \@@_usage:NN \l_keys_usage_preamble_prop
+ \@@_validity:NN \l_keys_validity_preamble_prop
\c_true_bool
}
}
{
\msg_error:nnnn { keys }
{ choice-unknown }
- { .usage:n }
+ { .validity:n }
{#1}
}
}
-\cs_new_protected:Npn \@@_usage:NN #1#2
+\cs_new_protected:Npn \@@_validity: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 \@@_usage:w \l_keys_path_str \s_@@_stop }
+ { \exp_after:wN \@@_validity: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 \@@_usage:w #1 / #2 \s_@@_stop {#2}
+\cs_new:Npn \@@_validity:w #1 / #2 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2638,8 +2638,8 @@
%
% \begin{macro}{.validity:n}
% \begin{macrocode}
-\cs_new_protected:cpn { \c_@@_props_root_str .usage:n } #1
- { \@@_usage:n {#1} }
+\cs_new_protected:cpn { \c_@@_props_root_str .validity:n } #1
+ { \@@_validity:n {#1} }
% \end{macrocode}
% \end{macro}
%
@@ -2657,7 +2657,7 @@
%
% \subsection{Key properties for \LaTeXe{} options}
%
-% \begin{macro}{.if, .store, .usage}
+% \begin{macro}{.if, .store, validity}
% \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 }
- { usage:n } { usage }
+ { validity:n } { validity }
{ \q_recursion_tail } { }
\q_recursion_stop
\group_end:
diff --git a/l3kernel/testfiles/m3keys007.lvt b/l3kernel/testfiles/m3keys007.lvt
index efa32b3e4..bd9642c13 100644
--- a/l3kernel/testfiles/m3keys007.lvt
+++ b/l3kernel/testfiles/m3keys007.lvt
@@ -17,21 +17,21 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST { .usage:n ~ basics }
+\TEST { .validity:n ~ basics }
{
\keys_define:nn { module }
{
key-one .code:n = #1 ,
- key-one .usage:n = load ,
+ key-one .validity:n = load ,
key-two .code:n = #1 ,
- key-two .usage:n = preamble ,
+ key-two .validity:n = preamble ,
key-three .code:n = #1 ,
- key-three .usage:n = general ,
+ key-three .validity:n = general ,
key-four .code:n = #1 ,
- key-four .usage:n = oops
+ key-four .validity:n = oops
}
- \prop_show:N \l_keys_usage_load_prop
- \prop_show:N \l_keys_usage_preamble_prop
+ \prop_show:N \l_keys_validity_load_prop
+ \prop_show:N \l_keys_validity_preamble_prop
}
\TEST { .usage:n ~ adding ~ and ~ removing }
@@ -39,18 +39,18 @@
\keys_define:nn { module }
{
key-one .code:n = #1 ,
- key-one .usage:n = load ,
+ key-one .validity:n = load ,
key-two .code:n = #1 ,
- key-two .usage:n = load ,
+ key-two .validity:n = load ,
key-three .code:n = #1 ,
- key-three .usage:n = load ,
- key-three .usage:n = preamble ,
+ key-three .validity:n = load ,
+ key-three .validity:n = preamble ,
key-four .code:n = #1 ,
- key-four .usage:n = load ,
- key-four .usage:n = general
+ key-four .validity:n = load ,
+ key-four .validity:n = general
}
- \prop_show:N \l_keys_usage_load_prop
- \prop_show:N \l_keys_usage_preamble_prop
+ \prop_show:N \l_keys_validity_load_prop
+ \prop_show:N \l_keys_validity_preamble_prop
}
\END
diff --git a/l3kernel/testfiles/m3keys007.tlg b/l3kernel/testfiles/m3keys007.tlg
index a0f91975f..8b80befae 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: .usage:n basics
+TEST 1: .validity: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 '.usage:n' accepts only a fixed set of choices.
+! LaTeX3 Error: Key '.validity:n' accepts only a fixed set of choices.
For immediate help type H <return>.
...
l. ... }
-The key '.usage:n' only accepts predefined values, and 'oops' is not one of
+The key '.validity:n' only accepts predefined values, and 'oops' is not one of
these.
-The property list \l_keys_usage_load_prop contains the pairs (without outer
+The property list \l_keys_validity_load_prop contains the pairs (without outer
braces):
> {module} => {key-one}.
<recently read> }
l. ... }
-The property list \l_keys_usage_preamble_prop contains the pairs (without
+The property list \l_keys_validity_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_usage_load_prop contains the pairs (without outer
+The property list \l_keys_validity_load_prop contains the pairs (without outer
braces):
> {module} => {key-one,key-two}.
<recently read> }
l. ... }
-The property list \l_keys_usage_preamble_prop contains the pairs (without
+The property list \l_keys_validity_preamble_prop contains the pairs (without
outer braces):
> {module} => {key-three}.
<recently read> }
More information about the latex3-commits
mailing list.