texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ManipulateTree.pm (move_index_entrie


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ManipulateTree.pm (move_index_entries_after_items), tp/Texinfo/XS/structuring_transfo/transformations.c (move_index_entries_after_items): consider a @subentry to be part of the moved index entries. Report from Thérèse Godefroy.
Date: Sun, 06 Oct 2024 07:27:53 -0400

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 5e8fccc9bd * tp/Texinfo/ManipulateTree.pm 
(move_index_entries_after_items), 
tp/Texinfo/XS/structuring_transfo/transformations.c 
(move_index_entries_after_items): consider a @subentry to be part of the moved 
index entries.  Report from Thérèse Godefroy.
5e8fccc9bd is described below

commit 5e8fccc9bd1fb775654ebb2e2334682a83cc47c0
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Oct 6 13:27:58 2024 +0200

    * tp/Texinfo/ManipulateTree.pm (move_index_entries_after_items),
    tp/Texinfo/XS/structuring_transfo/transformations.c
    (move_index_entries_after_items): consider a @subentry to be part of
    the moved index entries.  Report from Thérèse Godefroy.
    
    * tp/t/index_before_item.t (subentry): add test with @subentry in
    @cindex.
---
 ChangeLog                                           | 10 ++++++++++
 tp/Texinfo/ManipulateTree.pm                        |  4 +++-
 tp/Texinfo/XS/structuring_transfo/transformations.c |  4 +++-
 tp/t/index_before_item.t                            | 14 +++++++++++++-
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 932e969579..f5abaa3983 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-10-06  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ManipulateTree.pm (move_index_entries_after_items),
+       tp/Texinfo/XS/structuring_transfo/transformations.c
+       (move_index_entries_after_items): consider a @subentry to be part of
+       the moved index entries.  Report from Thérèse Godefroy.
+
+       * tp/t/index_before_item.t (subentry): add test with @subentry in
+       @cindex.
+
 2024-10-06  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/converter.c (converter_converter), 
diff --git a/tp/Texinfo/ManipulateTree.pm b/tp/Texinfo/ManipulateTree.pm
index 1a2ae7b132..423f1738b4 100644
--- a/tp/Texinfo/ManipulateTree.pm
+++ b/tp/Texinfo/ManipulateTree.pm
@@ -610,7 +610,9 @@ sub move_index_entries_after_items($)
           $last_entry_idx = $i;
         } elsif (not $content->{'cmdname'}
                  or ($content->{'cmdname'} ne 'c'
-                     and $content->{'cmdname'} ne 'comment')) {
+                     and $content->{'cmdname'} ne 'comment'
+                     # subentry is not within the index entry in the tree
+                     and $content->{'cmdname'} ne 'subentry')) {
           last;
         }
       }
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index fd0dbdf361..bebb2d1439 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -487,7 +487,9 @@ move_index_entries_after_items (ELEMENT *current)
                 last_entry_nr = j;
               else if ((!(type_data[content->type].flags & TF_at_command))
                        || (content->e.c->cmd != CM_comment
-                           && content->e.c->cmd != CM_c))
+                           && content->e.c->cmd != CM_c
+                      /* subentry is not within the index entry in the tree */
+                           && content->e.c->cmd != CM_subentry))
                 break;
             }
 
diff --git a/tp/t/index_before_item.t b/tp/t/index_before_item.t
index 8bfef44a9f..8556883ab9 100644
--- a/tp/t/index_before_item.t
+++ b/tp/t/index_before_item.t
@@ -5,7 +5,7 @@ use Texinfo::ModulePath (undef, undef, undef, 'updirs' => 2);
 
 use Test::More;
 
-BEGIN { plan tests => 6; }
+BEGIN { plan tests => 7; }
 
 use Texinfo::Parser;
 use Texinfo::Convert::Texinfo;
@@ -170,3 +170,15 @@ run_test('@itemize i
 @item e--mph item
 @end itemize
 ', 'only comment');
+
+run_test('@enumerate
+@cindex pattern @subentry variable
+@item
+Set the variable
+@end enumerate
+', '@enumerate
+@item
+@cindex pattern @subentry variable
+Set the variable
+@end enumerate
+', 'subentry');



reply via email to

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