[latex3-commits] [l3svn] r6675 - l3doc: keys module and deprecated for function and macro environments
noreply at latex-project.org
noreply at latex-project.org
Thu Aug 18 16:41:55 CEST 2016
Author: bruno
Date: 2016-08-18 16:41:55 +0200 (Thu, 18 Aug 2016)
New Revision: 6675
Modified:
trunk/l3kernel/l3doc.dtx
Log:
l3doc: keys module and deprecated for function and macro environments
I had only added "deprecated" to the function environment, now also added
to the macro environment, and using yyyy-mm-dd style dates rather than
yyyy/mm/dd. The "module" key overrides the module guessed by l3doc for
indexing of these instances of the functions/macros.
Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx 2016-08-18 14:07:23 UTC (rev 6674)
+++ trunk/l3kernel/l3doc.dtx 2016-08-18 14:41:55 UTC (rev 6675)
@@ -664,6 +664,7 @@
% \l_@@_macro_EXP_bool,
% \l_@@_macro_rEXP_bool,
% \l_@@_macro_var_bool,
+% \l_@@_override_module_tl,
% }
% Contain information about some options of function/macro
% environments:
@@ -675,6 +676,7 @@
\bool_new:N \l_@@_macro_EXP_bool
\bool_new:N \l_@@_macro_rEXP_bool
\bool_new:N \l_@@_macro_var_bool
+\tl_new:N \l_@@_override_module_tl
% \end{macrocode}
% \end{variable}
%
@@ -870,11 +872,11 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}[int]{\l_@@_function_argument_tl}
-% Save the argument of a \env{function} environment for use in error
-% messages.
+% \begin{variable}[int]{\l_@@_macro_argument_tl}
+% Save the argument of a \env{macro} or \env{function} environment for
+% use in error messages.
% \begin{macrocode}
-\tl_new:N \l_@@_function_argument_tl
+\tl_new:N \l_@@_macro_argument_tl
% \end{macrocode}
% \end{variable}
%
@@ -1207,9 +1209,9 @@
% \begin{macro}[aux]{\@@_date_compare_aux:nnnNnnn, \@@_date_compare_aux:w}
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_date_compare:nNn #1#2#3 { TF , T , F , p }
- { \@@_date_compare_aux:w #1/// \q_mark #2 #3/// \q_stop }
+ { \@@_date_compare_aux:w #1--- \q_mark #2 #3--- \q_stop }
\cs_new:Npn \@@_date_compare_aux:w
- #1 / #2 / #3 / #4 \q_mark #5 #6 / #7 / #8 / #9 \q_stop
+ #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop
{
\@@_date_compare_aux:nnnNnnn
{ \tl_if_empty:nTF {#1} { 0 } {#1} }
@@ -2109,6 +2111,7 @@
no-label .bool_set:N = \l_@@_no_label_bool ,
verb .value_forbidden:n = true ,
verb .bool_set:N = \l_@@_names_verb_bool ,
+ module .tl_set:N = \l_@@_override_module_tl ,
}
% \end{macrocode}
%
@@ -2120,7 +2123,7 @@
\@@_date_compare:nNnT {#1} < { \tex_year:D / \tex_month:D / \tex_day:D }
{
\msg_error:nnxx { l3doc } { deprecated-function }
- { \tl_to_str:N \l_@@_function_argument_tl } {#1}
+ { \tl_to_str:N \l_@@_macro_argument_tl } {#1}
}
}
% \end{macrocode}
@@ -2147,11 +2150,12 @@
{
\@@_function_typeset_start:
\@@_function_init:
- \tl_set:Nn \l_@@_function_argument_tl {#2}
+ \tl_set:Nn \l_@@_macro_argument_tl {#2}
\keys_set:nn { l3doc/function } {#1}
\@@_names_get_seq:nN {#2} \l_@@_names_seq
\@@_names_parse:
\@@_function_typeset:
+ \@@_function_reset:
\@@_function_descr_start:w
}
\cs_new_protected:Npn \@@_function_end:
@@ -2202,6 +2206,7 @@
\bool_set_false:N \l_@@_macro_rEXP_bool
\bool_set_false:N \l_@@_no_label_bool
\bool_set_false:N \l_@@_names_verb_bool
+ \tl_set:Nn \l_@@_override_module_tl { \q_no_value }
\char_set_catcode_active:N \<
\cs_set_protected:Npn < ##1 > { \meta {##1} }
}
@@ -2209,6 +2214,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[aux]{\@@_function_reset:}
+% Clear some variables.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_function_reset:
+ {
+ \tl_set:Nn \l_@@_override_module_tl { \q_no_value }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[aux]{\@@_function_typeset:}
% Typeset in the coffin \cs{l_@@_functions_coffin} the functions listed in
% \cs{l_@@_names_block_prop} and the relevant dates, then set
@@ -2502,7 +2517,9 @@
} ,
added .code:n = {} , % TODO
updated .code:n = {} , % TODO
+ deprecated .code:n = { \@@_deprecated_on:n {#1} } ,
verb .bool_set:N = \l_@@_names_verb_bool ,
+ module .tl_set:N = \l_@@_override_module_tl ,
}
% \end{macrocode}
%
@@ -2518,12 +2535,14 @@
\cs_new_protected:Npn \@@_macro:nnw #1#2
{
\@@_macro_init:
+ \tl_set:Nn \l_@@_macro_argument_tl {#2}
\keys_set:nn { l3doc/macro } {#1}
\@@_names_get_seq:nN {#2} \l_@@_names_seq
\@@_names_parse:
\@@_macro_adjust_internal:
\@@_names_typeset:
\@@_macro_dump:
+ \@@_macro_reset:
}
% \end{macrocode}
% \end{macro}
@@ -2545,6 +2564,7 @@
\bool_set_false:N \l_@@_macro_var_bool
\bool_set_false:N \l_@@_macro_tested_bool
\bool_set_false:N \l_@@_names_verb_bool
+ \tl_set:Nn \l_@@_override_module_tl { \q_no_value }
\cs_set_eq:NN \testfile \@@_print_testfile:n
\box_clear:N \l_@@_macro_index_box
\vbox_set:Nn \l_@@_macro_box
@@ -2556,6 +2576,17 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[aux]{\@@_macro_reset:}
+% We ensure that \cs{cs} commands nested inside a macro whose module
+% is imposed are not affected.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_macro_reset:
+ {
+ \tl_set:Nn \l_@@_override_module_tl { \q_no_value }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[aux]{\@@_macro_adjust_internal:}
% If the macros are neither marked as internal nor auxiliary, and all
% macros in \cs{l_@@_names_seq} contain |__| then mark them as being
@@ -3576,11 +3607,13 @@
% \end{macro}
%
% \begin{macro}[aux]{\@@_special_index:nn}
-% ^^A TODO comment TODO stringify?
+% ^^A TODO this override is somewhat a hack
% \begin{macrocode}
\cs_new_protected:Npn \@@_special_index:nn #1#2
{
\@@_key_get:n {#1}
+ \quark_if_no_value:NF \l_@@_override_module_tl
+ { \tl_set_eq:NN \l_@@_index_module_tl \l_@@_override_module_tl }
\@@_special_index_module:ooonN
{ \l_@@_index_key_tl }
{ \l_@@_index_macro_tl }
More information about the latex3-commits
mailing list