[latex3-commits] [git/LaTeX3-latex3-latex3] main: l3doc: in each index entry, list page refs before codeline refs (74e4207b0)

Bruno Le Floch blflatex at gmail.com
Fri Apr 30 17:37:13 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/74e4207b09c8109705e70c120ebf8c29321f2553

>---------------------------------------------------------------

commit 74e4207b09c8109705e70c120ebf8c29321f2553
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Fri Apr 30 17:04:47 2021 +0200

    l3doc: in each index entry, list page refs before codeline refs


>---------------------------------------------------------------

74e4207b09c8109705e70c120ebf8c29321f2553
 l3kernel/l3doc.dtx | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 00f5f7aa6..9bf1e3278 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -3772,13 +3772,17 @@ and all files in that bundle must be distributed together.
   }
 %    \end{macrocode}
 %
+% Here, |ACODELINE| is interpreted by |makeindex| as an uppercase latin
+% letter page.  We cannot use |CODELINE| because the |C| makes it look
+% like a roman numeral and |makeindex| then complains about the~|O|.
+% Better word welcome.
 %    \begin{macrocode}
 \cs_gset:Npn \codeline at wrindex #1
   {
     \immediate\write\@indexfile
       {
         \string\indexentry{#1}
-          { \filesep \int_use:N \c at CodelineNo }
+          { ACODELINE - \filesep \int_use:N \c at CodelineNo }
       }
   }
 \tl_gclear:N \filesep
@@ -4222,11 +4226,27 @@ and all files in that bundle must be distributed together.
           \l_@@_index_escaped_macro_tl
         }
         \encapchar
-        hdclindex{\the\c at HD@hypercount}{#6}
+        codelinehdclindex{\the\c at HD@hypercount}{#6}
       }
   }
 %    \end{macrocode}
 %
+% \begin{macro}{\codelinehdclindex}
+%   Note that |#3| here could contain |ACODELINE-| more than once if
+%   several successive code lines have been merged into a range somehow.
+%   Note that the dash following |ACODELINE| is active in
+%   |interface3.tex| and in |source3.tex| at least, so we cannot simply
+%   search and remove |ACODELINE-|.
+%    \begin{macrocode}
+\cs_new_protected:Npn \codelinehdclindex #1#2#3
+  {
+    \tl_set:Nn \l_@@_tmpa_tl {#3}
+    \tl_replace_all:Nnn \l_@@_tmpa_tl { ACODELINE } { \use_none:n }
+    \exp_args:Nnno \hdclindex {#1} {#2} \l_@@_tmpa_tl
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_special_index_set:Nn #1#2
   {





More information about the latex3-commits mailing list.