[latex3-commits] [l3svn] r6678 - l3doc: fix pluralisation with documented-as option

noreply at latex-project.org noreply at latex-project.org
Thu Aug 18 22:50:55 CEST 2016


Author: bruno
Date: 2016-08-18 22:50:55 +0200 (Thu, 18 Aug 2016)
New Revision: 6678

Modified:
   trunk/l3kernel/l3doc.dtx
Log:
l3doc: fix pluralisation with documented-as option

Since "documented-as=\foo_bar:" replaced the (possibly long)
list of macros by that single "\foo_bar:" for the purposes of
"Th(is|ese) function( is|s are) documented on page [...]",
the pluralization ended up wrong.  Simply reorder the code.


Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx	2016-08-18 20:30:17 UTC (rev 6677)
+++ trunk/l3kernel/l3doc.dtx	2016-08-18 20:50:55 UTC (rev 6678)
@@ -665,7 +665,7 @@
 %     \l_@@_macro_rEXP_bool,
 %     \l_@@_macro_var_bool,
 %     \l_@@_override_module_tl,
-%     \l_@@_macro_documented_clist,
+%     \l_@@_macro_documented_tl,
 %   }
 %   Contain information about some options of function/macro
 %   environments.  We initialize \cs{l_@@_override_module_tl} to avoid
@@ -680,7 +680,7 @@
 \bool_new:N \l_@@_macro_var_bool
 \tl_new:N \l_@@_override_module_tl
 \tl_set:Nn \l_@@_override_module_tl { \q_no_value }
-\clist_new:N \l_@@_macro_documented_clist
+\tl_new:N \l_@@_macro_documented_tl
 %    \end{macrocode}
 % \end{variable}
 %
@@ -2546,7 +2546,7 @@
     deprecated .code:n = { \@@_deprecated_on:n {#1} } ,
     verb .bool_set:N = \l_@@_names_verb_bool ,
     module .tl_set:N = \l_@@_override_module_tl ,
-    documented-as .clist_set:N = \l_@@_macro_documented_clist ,
+    documented-as .tl_set:N = \l_@@_macro_documented_tl ,
   }
 %    \end{macrocode}
 %
@@ -2592,7 +2592,7 @@
     \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 }
-    \clist_clear:N \l_@@_macro_documented_clist
+    \tl_clear:N \l_@@_macro_documented_tl
     \cs_set_eq:NN \testfile \@@_print_testfile:n
     \box_clear:N \l_@@_macro_index_box
     \vbox_set:Nn \l_@@_macro_box
@@ -2970,24 +2970,27 @@
         ! \l_@@_macro_internal_bool
       }
       {
-        \clist_if_empty:NF \l_@@_macro_documented_clist
+        \int_set:Nn \l_@@_tmpa_int
+          { \seq_count:N \g_@@_nested_names_seq }
+        \tl_if_empty:NTF \l_@@_macro_documented_tl
           {
-            \seq_gset_from_clist:NN
-              \g_@@_nested_names_seq
-              \l_@@_macro_documented_clist
-            \seq_gset_map:NNn \g_@@_nested_names_seq
-              \g_@@_nested_names_seq
-              { \tl_to_str:o { \token_to_str:N ##1 } }
+            \tl_set:Nx \l_@@_macro_documented_tl
+              { \seq_item:Nn \g_@@_nested_names_seq { 1 } }
           }
-        \int_set:Nn \l_@@_tmpa_int
-          { \seq_count:N \g_@@_nested_names_seq }
+          {
+            \tl_set:Nf \l_@@_macro_documented_tl
+              {
+                \exp_after:wN \token_to_str:N
+                \l_@@_macro_documented_tl
+              }
+          }
         \int_compare:nNnTF \l_@@_tmpa_int = 1 {~This~} {~These~}
         \bool_if:NTF \l_@@_macro_var_bool {variable} {function}
         \int_compare:nNnTF \l_@@_tmpa_int = 1 {~is~} {s~are~}
         documented~on~page~
         \bool_set_false:N \l_@@_macro_TF_bool
-        \exp_args:Nx \@@_get_hyper_target:nN
-          { \seq_item:Nn \g_@@_nested_names_seq { 1 } }
+        \exp_args:No \@@_get_hyper_target:nN
+          \l_@@_macro_documented_tl
           \l_@@_tmpa_tl
         \exp_args:Nx \pageref { \l_@@_tmpa_tl } .
       }



More information about the latex3-commits mailing list