texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Wed, 23 Oct 2024 11:49:01 -0400 (EDT)

branch: master
commit 73a2e24249d08a70c7857fddc1a78cd0dfaf39ad
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 23 16:52:02 2024 +0200

    * tp/Texinfo/ManipulateTree.pm (move_index_entries_after_items),
    tp/Texinfo/XS/structuring_transfo/transformations.c
    (move_index_entries_after_items): change the logic of the condition
    on continuing to go through elements if not among some commands to
    have a positive condition on commands.  Use TF_text to make sure that
    the element is a container element now that it is clear that the
    main objective of that part of the condition is to be able to access
    CONTAINER fields.
---
 ChangeLog                                           | 11 +++++++++++
 tp/Texinfo/ManipulateTree.pm                        |  8 ++++----
 tp/Texinfo/XS/structuring_transfo/transformations.c |  8 ++++----
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b8205edfc..ede33055f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-10-23  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): change the logic of the condition
+       on continuing to go through elements if not among some commands to
+       have a positive condition on commands.  Use TF_text to make sure that
+       the element is a container element now that it is clear that the
+       main objective of that part of the condition is to be able to access
+       CONTAINER fields.
+
 2024-10-23  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/handle_commands.c,
diff --git a/tp/Texinfo/ManipulateTree.pm b/tp/Texinfo/ManipulateTree.pm
index 423f1738b4..d337a11e4f 100644
--- a/tp/Texinfo/ManipulateTree.pm
+++ b/tp/Texinfo/ManipulateTree.pm
@@ -608,11 +608,11 @@ sub move_index_entries_after_items($)
         my $content = $previous_ending_container->{'contents'}->[$i];
         if ($content->{'type'} and $content->{'type'} eq 
'index_entry_command') {
           $last_entry_idx = $i;
-        } elsif (not $content->{'cmdname'}
-                 or ($content->{'cmdname'} ne 'c'
-                     and $content->{'cmdname'} ne 'comment'
+        } elsif (not ($content->{'cmdname'}
+                      and ($content->{'cmdname'} eq 'c'
+                           or $content->{'cmdname'} eq 'comment'
                      # subentry is not within the index entry in the tree
-                     and $content->{'cmdname'} ne 'subentry')) {
+                           or $content->{'cmdname'} eq 'subentry'))) {
           last;
         }
       }
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 90495510a4..475143be28 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -485,11 +485,11 @@ move_index_entries_after_items (ELEMENT *current)
                 = previous_ending_container->e.c->contents.list[j-1];
               if (content->type == ET_index_entry_command)
                 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
+              else if (!(!(type_data[content->type].flags & TF_text)
+                         && (content->e.c->cmd == CM_comment
+                             || content->e.c->cmd == CM_c
                       /* subentry is not within the index entry in the tree */
-                           && content->e.c->cmd != CM_subentry))
+                             || content->e.c->cmd == CM_subentry)))
                 break;
             }
 



reply via email to

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