texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/parsetexi/indices.c (enter_index_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry): remove the number field from the index entry structure as it is not used, the position in the index array is directly used in api.c.
Date: Sat, 18 Feb 2023 09:35:41 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f22b97f51a * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry): 
remove the number field from the index entry structure as it is not used, the 
position in the index array is directly used in api.c.
f22b97f51a is described below

commit f22b97f51a6146dfe4e6a3fe3ae04f79a984029f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 18 15:30:20 2023 +0100

    * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry): remove
    the number field from the index entry structure as it is not
    used, the position in the index array is directly used in api.c.
    
    * tp/Texinfo/ParserNonXS.pm: update POD documentation of index
    entries, add index related extra keys documentation.
---
 ChangeLog                            |  9 +++++++
 tp/Texinfo/ParserNonXS.pm            | 48 +++++++++++++++++++++++++-----------
 tp/Texinfo/XS/parsetexi/indices.c    |  9 +++----
 tp/Texinfo/XS/parsetexi/tree_types.h |  4 +--
 4 files changed, 47 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b6f3b6dccc..357829ddbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-02-18  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/indices.c (enter_index_entry): remove
+       the number field from the index entry structure as it is not
+       used, the position in the index array is directly used in api.c.
+
+       * tp/Texinfo/ParserNonXS.pm: update POD documentation of index
+       entries, add index related extra keys documentation.
+
 2023-02-18  Gavin Smith <gavinsmith0123@gmail.com>
 
        * Texinfo/Convert/HTML.pm (_convert_def_line_type) <DEF_TABLE>:
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index b3bb0ad9cf..03a42fd3ca 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -7619,31 +7619,18 @@ The keys of the index entry structures are
 
 =item index_name
 
-The index name.
-
-=item index_ignore_chars
-
-A string containing the characters flagged as ignored in key sorting
-in the document by setting flags such as I<txiindexbackslashignore>.
+The index name associated to the command.  Not modified if the corresponding
+index is merged in another index (with C<@synindex>, for example).
 
 =item entry_element
 
 The element in the parsed tree associated with the @-command holding the
 index entry.
 
-=item entry_node
-
-The node in the parsed tree containing the index entry.
-
 =item entry_number
 
 The number of the index entry.
 
-=item entry_region
-
-The region command (C<@copying>, C<@titlepage>) containing the index entry,
-if it is in such an environement.
-
 =back
 
 =back
@@ -8275,12 +8262,30 @@ X<Texinfo tree element extra key>
 
 =over
 
+=item element_node
+
+The node element in the parsed tree containing the element.
+Set for @-commands elements that have an associated
+index entry.
+
+=item element_region
+
+The region command (C<@copying>, C<@titlepage>) containing the element,
+if it is in such an environement.  Set for @-commands elements that have an
+associated index entry.
+
 =item index_entry
 
 The index entry information (described in L</index_entries>
 in details) is associated to @-commands that have an associated
 index entry.
 
+=item index_ignore_chars
+
+A string containing the characters flagged as ignored in key sorting in the
+document by setting flags such as I<txiindexbackslashignore>.  Set, if
+not empty, for @-commands elements that have an associated index entry.
+
 =item misc_args
 
 An array holding strings, the arguments of @-commands taking simple
@@ -8392,6 +8397,19 @@ I<caption> and I<shortcaption> holds the corresponding
 tree elements for float.  The C<@caption> or C<@shortcaption>
 have the float tree element stored in I<float>.
 
+=item index entry @-command
+
+=item C<@subentry>
+
+If an index entry @-command, such as C<@cindex>, or a C<@subentry> contains
+a C<@sortas> command, I<sortas> holds the C<@sortas> command content
+formatted as plain text.
+
+I<subentry> links to the next level C<@subentry> element.
+
+Index entry @-command (but not C<@subentry>) can also have I<seentry>
+and I<seealso> keys that link to the corresponding @-commands elements.
+
 =item C<@inlinefmt>
 
 =item C<@inlineraw>
diff --git a/tp/Texinfo/XS/parsetexi/indices.c 
b/tp/Texinfo/XS/parsetexi/indices.c
index a638ed2b91..162a9932f0 100644
--- a/tp/Texinfo/XS/parsetexi/indices.c
+++ b/tp/Texinfo/XS/parsetexi/indices.c
@@ -253,12 +253,9 @@ typedef struct {
 
 
 /* INDEX_TYPE_CMD is used to determine which index to enter the entry in.
-   CONTENT is an element whose contents represent the text of the
    index entry.  ELEMENT is the element in the main body of the manual that
    the index entry refers/belongs to.
-
-   CONTENT_NORMALIZED would be "the index entry content, independent
-   of the current language." */
+*/
 void
 enter_index_entry (enum command_id index_type_cmd,
                    ELEMENT *element)
@@ -280,8 +277,10 @@ enter_index_entry (enum command_id index_type_cmd,
   memset (entry, 0, sizeof (INDEX_ENTRY));
 
   entry->index_name = idx->name;
-  entry->command = element;
+  /* not needed, the position in the index is directly used
   entry->number = idx->index_number;
+  */
+  entry->command = element;
 
   /* Create ignored_chars string. */
   text_init (&ignored_chars);
diff --git a/tp/Texinfo/XS/parsetexi/tree_types.h 
b/tp/Texinfo/XS/parsetexi/tree_types.h
index cec42b0955..98831fc73e 100644
--- a/tp/Texinfo/XS/parsetexi/tree_types.h
+++ b/tp/Texinfo/XS/parsetexi/tree_types.h
@@ -129,10 +129,8 @@ typedef struct IGNORED_CHARS {
 } IGNORED_CHARS;
 
 typedef struct {
-    char *index_name;
-
+    char *index_name; /* kept with the entry as the indices may be merged */
     ELEMENT *command;
-    int number; /* Index of entry in containing index, 1-based. */
 } INDEX_ENTRY;
 
 typedef struct INDEX {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]