[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 6cdbda17c2dac12e367626b80d6620bfe3d0445a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 23 17:40:13 2024 +0200
* tp/Texinfo/XS/structuring_transfo/transformations.c
(complete_node_menu): inverse the condition for offset_at_end for a
more readable condition (also like Perl). 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 | 9 +++++++++
tp/Texinfo/XS/structuring_transfo/transformations.c | 8 ++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ede33055f4..327d640e97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-10-23 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/structuring_transfo/transformations.c
+ (complete_node_menu): inverse the condition for offset_at_end for a
+ more readable condition (also like Perl). 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/ManipulateTree.pm (move_index_entries_after_items),
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 475143be28..26318c415d 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -1076,13 +1076,13 @@ complete_node_menu (ELEMENT *node, int use_sections)
}
else
{
- int offset_at_end = -1;
+ int offset_at_end = 0;
const ELEMENT *last_menu_content
= last_contents_child (current_menu);
- if (!(type_data[last_menu_content->type].flags & TF_at_command)
- || last_menu_content->e.c->cmd != CM_end)
- offset_at_end = 0;
+ if (!(type_data[last_menu_content->type].flags & TF_text)
+ && last_menu_content->e.c->cmd == CM_end)
+ offset_at_end = -1;
insert_list_slice_into_contents (current_menu,
current_menu->e.c->contents.number +
offset_at_end,
pending, 0, pending->number);