[latex3-commits] [l3svn] r6671 - l3doc: split subindex for internal/public commands

noreply at latex-project.org noreply at latex-project.org
Thu Aug 18 13:40:16 CEST 2016


Author: bruno
Date: 2016-08-18 13:40:16 +0200 (Thu, 18 Aug 2016)
New Revision: 6671

Modified:
   trunk/l3kernel/l3doc.dtx
Log:
l3doc: split subindex for internal/public commands

For each module we now have a "<module> commands" and a
"<module> internal commands" subindexes.



Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx	2016-08-18 10:46:43 UTC (rev 6670)
+++ trunk/l3kernel/l3doc.dtx	2016-08-18 11:40:16 UTC (rev 6671)
@@ -748,16 +748,22 @@
 % \end{variable}
 %
 % \begin{variable}
-%   {\l_@@_index_macro_tl, \l_@@_index_key_tl, \l_@@_index_module_tl}
+%   {
+%     \l_@@_index_macro_tl, \l_@@_index_key_tl,
+%     \l_@@_index_module_tl, \l_@@_index_internal_bool
+%   }
 %   When analyzing a control sequence found within a \env{macrocode}
 %   environment, \cs{l_@@_index_macro_tl} holds the control sequence
 %   (partially a string), \cs{l_@@_index_key_tl} holds what will be used
 %   as a sort key in the index, and \cs{l_@@_index_module_tl} is the
-%   subindex in which the control sequence will be listed.
+%   subindex in which the control sequence will be listed.  Finally,
+%   \cs{l_@@_index_internal_bool} indicates when the control sequence is
+%   internal and should be indexed in a slightly different subindex.
 %    \begin{macrocode}
 \tl_new:N \l_@@_index_macro_tl
 \tl_new:N \l_@@_index_key_tl
 \tl_new:N \l_@@_index_module_tl
+\bool_new:N \l_@@_index_internal_bool
 %    \end{macrocode}
 % \end{variable}
 %
@@ -1703,11 +1709,12 @@
             \tl_set:Nx \l_@@_index_module_tl
               { \tl_to_str:N \l_@@_cmd_module_tl }
           }
-        \@@_special_index_module:ooon
+        \@@_special_index_module:ooonN
           { \l_@@_index_key_tl }
           { \l_@@_index_macro_tl }
           { \l_@@_index_module_tl }
           { }
+          \l_@@_index_internal_bool
       }
   }
 %    \end{macrocode}
@@ -3452,11 +3459,12 @@
   {
     \use:x
       {
-        \@@_special_index_module:nnnn
+        \@@_special_index_module:nnnnN
           { \quotechar #1 }
           { \quotechar \bslash \quotechar #1 }
           { }
           { }
+          \c_false_bool
       }
   }
 %    \end{macrocode}
@@ -3468,11 +3476,12 @@
 \cs_new_protected:Npn \@@_special_index:nn #1#2
   {
     \exp_args:Nx \@@_key_get:n { \@@_base_form:n {#1} }
-    \@@_special_index_module:ooon
+    \@@_special_index_module:ooonN
       { \l_@@_index_key_tl }
       { \l_@@_index_macro_tl }
       { \l_@@_index_module_tl }
       {#2}
+      \l_@@_index_internal_bool
   }
 \cs_generate_variant:Nn \@@_special_index:nn { o }
 %    \end{macrocode}
@@ -3480,10 +3489,9 @@
 %
 % \begin{macro}
 %   {
-%     \@@_special_index_module:nnnn,
-%     \@@_special_index_module:ooon,
-%     \@@_special_index_aux:nnnnn,
-%     \@@_special_index_aux:onnnn,
+%     \@@_special_index_module:nnnnN,
+%     \@@_special_index_module:ooonN,
+%     \@@_special_index_aux:nnnnnn,
 %     \@@_special_index_set:Nn,
 %   }
 %   Remotely based on Heiko's replacement to play nicely with
@@ -3493,33 +3501,37 @@
 %   a construct such as |\meta{...}|.
 %    \begin{macrocode}
 \tl_new:N \l_@@_index_escaped_macro_tl
-\cs_new_protected:Npn \@@_special_index_module:nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_special_index_module:nnnnN #1#2#3#4#5
   {
     \use:x
       {
-        \exp_not:n { \@@_special_index_aux:nnnnn {#1} {#2} }
-          \str_case_x:nnF {#3}
+        \exp_not:n { \@@_special_index_aux:nnnnnn {#1} {#2} }
+          \tl_if_empty:nTF {#3}
+            { { } { } { } }
             {
-              { } { { } { } }
-              { TeX }
+              \str_if_eq_x:nnTF {#3} { TeX }
                 {
-                  { TeX~and~LaTeX2e~commands }
-                  { \string\TeX{}~and~\string\LaTeXe{}~commands: }
+                  { TeX~and~LaTeX2e }
+                  { \string\TeX{}~and~\string\LaTeXe{} }
                 }
+                {
+                  {#3}
+                  { \string\pkg{#3} }
+                }
+              { \bool_if:NT #5 { ~internal } ~commands: }
             }
-            { { #3~commands } { \string\pkg{#3}~commands: } }
       }
           {#4}
   }
-\cs_generate_variant:Nn \@@_special_index_module:nnnn { ooo }
-\cs_new_protected:Npn \@@_special_index_aux:nnnnn #1#2#3#4#5
+\cs_generate_variant:Nn \@@_special_index_module:nnnnN { ooo }
+\cs_new_protected:Npn \@@_special_index_aux:nnnnnn #1#2#3#4#5#6
   {
     \HD at target
     \@@_special_index_set:Nn \l_@@_index_escaped_macro_tl {#2}
     \index
       {
-        \tl_if_empty:nF { #3 #4 }
-          { #3 \actualchar #4 \levelchar }
+        \tl_if_empty:nF { #3 #4 #5 }
+          { #3 #5 \actualchar #4 #5 \levelchar }
         #1
         \actualchar
         {
@@ -3527,10 +3539,9 @@
           \l_@@_index_escaped_macro_tl
         }
         \encapchar
-        hdclindex{\the\c at HD@hypercount}{#5}
+        hdclindex{\the\c at HD@hypercount}{#6}
       }
   }
-\cs_generate_variant:Nn \@@_special_index_aux:nnnnn { o }
 \cs_new_protected:Npn \@@_special_index_set:Nn #1#2
   {
     \tl_set:Nx #1 { \tl_to_str:n {#2} }
@@ -3589,6 +3600,9 @@
     \tl_set:Nx \l_@@_index_key_tl
       { \tl_to_str:N \l_@@_index_macro_tl }
     \tl_clear:N \l_@@_index_module_tl
+    \tl_if_in:NoTF \l_@@_index_key_tl { \tl_to_str:n { __ } }
+      { \bool_set_true:N \l_@@_index_internal_bool }
+      { \bool_set_false:N \l_@@_index_internal_bool }
     \tl_if_head_eq_charcode:oNT
       { \l_@@_index_key_tl } \c_@@_backslash_token
       { \@@_key_pop: }



More information about the latex3-commits mailing list