texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Mon, 19 Feb 2024 16:12:55 -0500 (EST)

branch: master
commit 9cdfe94d0bfcf818e3761c6ca50e758d90fad79d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 19 15:24:17 2024 +0100

    * tp/Texinfo/Structuring.pm (_insert_menu_comment_content)
    (new_complete_node_menu, _print_down_menus),
    tp/Texinfo/Transformations.pm (complete_tree_nodes_menus),
    tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
    (complete_tree_nodes_missing_menu),
    tp/Texinfo/XS/structuring_transfo/structuring.c
    (insert_menu_comment_content, new_complete_node_menu)
    (print_down_menus),
    tp/Texinfo/XS/structuring_transfo/transformations.c
    (complete_tree_nodes_missing_menu): Add comment lines in generated
    main menus for the start of the appendices or @part's.  Add
    $customization_information argument for translations.  Add
    insert_menu_comment_content for the comment insertion based on
    _print_down_menus code.
    Update callers.
---
 ChangeLog                                          |  18 +++
 tp/Texinfo/Structuring.pm                          | 113 +++++++++++++----
 tp/Texinfo/Transformations.pm                      |  17 ++-
 .../XS/structuring_transfo/StructuringTransfoXS.xs |   7 +-
 tp/Texinfo/XS/structuring_transfo/structuring.c    | 138 +++++++++++++++++----
 tp/Texinfo/XS/structuring_transfo/structuring.h    |   3 +-
 .../XS/structuring_transfo/transformations.c       |   6 +-
 .../XS/structuring_transfo/transformations.h       |   3 +-
 tp/t/automatic_menus.t                             |   2 +-
 .../indices/index_entry_in_footnote_sections.pl    |   8 +-
 .../index_entry_in_footnote_sections_separate.pl   |   8 +-
 .../res_info/index_special_region.info             | Bin 2594 -> 2606 bytes
 .../index_special_region_no_insertcopying.info     | Bin 1625 -> 1637 bytes
 .../index_special_region_no_insertcopying.info     | Bin 1625 -> 1637 bytes
 .../res_info/index_special_region.info             | Bin 2821 -> 2833 bytes
 .../chapter_between_nodes_with_appendix.pl         |   4 +-
 .../chapter_between_nodes_with_appendix_nomenu.pl  |   4 +-
 tp/t/test_utils.pl                                 |   3 +-
 tp/texi2any.pl                                     |   3 +-
 19 files changed, 271 insertions(+), 66 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5a0166b732..43b1a15190 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2024-02-19  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Structuring.pm (_insert_menu_comment_content)
+       (new_complete_node_menu, _print_down_menus),
+       tp/Texinfo/Transformations.pm (complete_tree_nodes_menus),
+       tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+       (complete_tree_nodes_missing_menu),
+       tp/Texinfo/XS/structuring_transfo/structuring.c
+       (insert_menu_comment_content, new_complete_node_menu)
+       (print_down_menus),
+       tp/Texinfo/XS/structuring_transfo/transformations.c
+       (complete_tree_nodes_missing_menu): Add comment lines in generated
+       main menus for the start of the appendices or @part's.  Add
+       $customization_information argument for translations.  Add
+       insert_menu_comment_content for the comment insertion based on
+       _print_down_menus code.
+       Update callers.
+
 2024-02-18  Patrice Dumas  <pertusus@free.fr>
 
        Only allow highlighting commands to be redefined with @definfoenclose
diff --git a/tp/Texinfo/Structuring.pm b/tp/Texinfo/Structuring.pm
index e56cff7d23..45258d3a1e 100644
--- a/tp/Texinfo/Structuring.pm
+++ b/tp/Texinfo/Structuring.pm
@@ -1405,9 +1405,38 @@ sub new_block_command($$)
   return $element;
 }
 
+sub _insert_menu_comment_content($$$;$)
+{
+  my $menu_contents = shift;
+  my $position = shift;
+  my $inserted_element = shift;
+  my $no_leading_empty_line = shift;
+
+  my $menu_comment = {'type' => 'menu_comment', 'contents' => []};
+  my $preformatted = {'type' => 'preformatted', 'parent' => $menu_comment,
+                      'contents' => []};
+  $menu_comment->{'contents'}->[0] = $preformatted;
+
+  if (!$no_leading_empty_line) {
+    push @{$preformatted->{'contents'}},
+           {'text' => "\n", 'type' => 'empty_line'};
+  }
+
+  push @{$preformatted->{'contents'}},
+          @{$inserted_element->{'contents'}},
+          {'text' => "\n", 'type' => 'empty_line'},
+          {'text' => "\n", 'type' => 'empty_line'};
+
+  foreach my $content (@{$preformatted->{'contents'}}) {
+    $content->{'parent'} = $preformatted;
+  }
+  splice (@$menu_contents, $position, 0, $menu_comment);
+}
+
+# $CUSTOMIZATION_INFORMATION is only used for the top menu
 sub new_complete_node_menu
 {
-  my ($node, $use_sections) = @_;
+  my ($node, $customization_information, $use_sections) = @_;
 
   my @node_childs = get_node_node_childs_from_sectioning($node);
 
@@ -1427,6 +1456,55 @@ sub new_complete_node_menu
     }
   }
 
+  # in top node, insert menu comments for parts and for the first appendix
+  if ($section and $section->{'cmdname'} eq 'top'
+      and $customization_information
+      and $node->{'extra'}->{'normalized'}
+      and $node->{'extra'}->{'normalized'} eq 'Top') {
+    my $content_index = 0;
+    my $in_appendix = 0;
+    foreach my $child (@node_childs) {
+      # can happen with node without argument or with empty argument
+      if (!$child->{'extra'} or !$child->{'extra'}->{'is_target'}) {
+        next;
+      }
+
+      my $child_section = $child->{'extra'}->{'associated_section'};
+      if ($child_section) {
+        my $part_added = 0;
+        my $associated_part = $child->{'extra'}->{'associated_part'};
+        if ($associated_part and $associated_part->{'args'}
+            and scalar(@{$associated_part->{'args'}}) > 0) {
+          my $part_title_copy
+            = Texinfo::Common::copy_contentsNonXS(
+                                $associated_part->{'args'}->[0]);
+          my $part_title
+           = Texinfo::Translations::gdt($customization_information,
+                                        'Part: {part_title}',
+                    $customization_information->get_conf('documentlanguage'),
+                                     {'part_title' => $part_title_copy});
+          _insert_menu_comment_content($new_menu->{'contents'}, $content_index,
+                                       $part_title, ($content_index == 0));
+          $content_index++;
+          $part_added = 1;
+        }
+        if (!$in_appendix
+            and $appendix_commands{$child_section->{'cmdname'}}) {
+          my $appendix_title
+             = Texinfo::Translations::gdt($customization_information,
+                                          'Appendices',
+                   $customization_information->get_conf('documentlanguage'));
+          _insert_menu_comment_content($new_menu->{'contents'}, $content_index,
+                                       $appendix_title,
+                                       ($content_index == 0 or $part_added));
+          $content_index++;
+          $in_appendix++;
+        }
+      }
+      $content_index++;
+    }
+  }
+
   new_block_command($new_menu, 'menu');
 
   return $new_menu;
@@ -1489,7 +1567,7 @@ sub new_complete_menu_master_menu($$$)
   my $labels = shift;
   my $node = shift;
 
-  my $menu_node = new_complete_node_menu($node);
+  my $menu_node = new_complete_node_menu($node, $self);
   if ($menu_node
       and $node->{'extra'}->{'normalized'}
       and $node->{'extra'}->{'normalized'} eq 'Top'
@@ -1531,7 +1609,8 @@ sub _print_down_menus($$;$)
     @menus = @{$node->{'extra'}->{'menus'}};
   } else {
     my $current_menu
-      = Texinfo::Structuring::new_complete_node_menu($node, $use_sections);
+      = Texinfo::Structuring::new_complete_node_menu($node, undef,
+                                                     $use_sections);
     if (defined($current_menu)) {
       @menus = ( $current_menu );
     } else {
@@ -1566,20 +1645,9 @@ sub _print_down_menus($$;$)
 
     my $node_title_copy
       = Texinfo::Common::copy_contentsNonXS($node_name_element);
-    my $menu_comment = {'type' => 'menu_comment', 'contents' => []};
-    my $preformatted = {'type' => 'preformatted', 'parent' => $menu_comment};
-    $menu_comment->{'contents'}->[0] = $preformatted;
 
-    $preformatted->{'contents'}
-      = [{'text' => "\n", 'type' => 'empty_line'},
-         @{$node_title_copy->{'contents'}},
-         {'text' => "\n", 'type' => 'empty_line'},
-         {'text' => "\n", 'type' => 'empty_line'}];
-
-    foreach my $content (@{$preformatted->{'contents'}}) {
-      $content->{'parent'} = $preformatted;
-    }
-    unshift @master_menu_contents, $menu_comment;
+    _insert_menu_comment_content(\@master_menu_contents, 0,
+                                 $node_title_copy, 0);
 
     # now recurse in the children
     foreach my $child (@node_children) {
@@ -2369,20 +2437,23 @@ X<C<new_block_command>>
 Complete I<$element> by adding the I<$command_name>, the command line
 argument and C<@end> to turn the element to a proper block command.
 
-=item $new_menu = new_complete_node_menu($node, $use_sections)
+=item $new_menu = new_complete_node_menu($node, $customization_information, 
$use_sections)
 X<C<new_complete_node_menu>>
 
 Returns a texinfo tree menu for node I<$node>, pointing to the children
 of the node obtained with the sectioning structure.  If I<$use_sections>
 is set, use section names for the menu entry names.
+I<$customization_information>, if defined, should hold information
+needed for translations.  Translations are only needed when generating the
+top node menu.
 
-=item $detailmenu = new_master_menu($translations, $identifier_target, $menus)
+=item $detailmenu = new_master_menu($customization_information, 
$identifier_target, $menus)
 X<C<new_master_menu>>
 
 Returns a detailmenu tree element formatted as a master node.
-I<$translations>, if defined, should be a L<Texinfo::Translations> object and
-should also hold customization information. I<$menus> is an array
-reference containing the regular menus of the Top node.
+I<$menus> is an array reference containing the regular menus of the Top node.
+I<$customization_information>, if defined, should hold information
+needed for translations.
 
 =item $entry = new_node_menu_entry($node, $use_sections)
 X<C<new_node_menu_entry>>
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index e93dfaa530..67c5b3e2cf 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -606,9 +606,12 @@ sub complete_tree_nodes_menus($;$)
 }
 
 # this only complete menus if there was no menu
-sub complete_tree_nodes_missing_menu($;$)
+# customization_information is used to pass down a translatable object with
+# customization information for the gdt() call.
+sub complete_tree_nodes_missing_menu($;$$)
 {
   my $root = shift;
+  my $customization_information = shift;
   my $use_sections = shift;
 
   my $non_automatic_nodes = _get_non_automatic_nodes_with_sections($root);
@@ -617,7 +620,8 @@ sub complete_tree_nodes_missing_menu($;$)
         or not scalar(@{$node->{'extra'}->{'menus'}})) {
       my $section = $node->{'extra'}->{'associated_section'};
       my $current_menu
-        = Texinfo::Structuring::new_complete_node_menu($node, $use_sections);
+        = Texinfo::Structuring::new_complete_node_menu($node,
+                                 $customization_information, $use_sections);
       if (defined($current_menu)) {
         _prepend_new_menu_in_node_section($node, $section, $current_menu);
       }
@@ -969,12 +973,15 @@ C<$add_section_names_in_entries> argument is set, a menu 
entry
 name is added using the section name.  This function should be
 called after L<sectioning_structure|Texinfo::Structuring/$sections_list = 
sectioning_structure($tree, $registrar, $customization_information)>.
 
-=item complete_tree_nodes_missing_menu($tree, $use_section_names_in_entries)
+=item complete_tree_nodes_missing_menu($tree, $customization_information, 
$use_section_names_in_entries)
 X<C<complete_tree_nodes_missing_menu>>
 
 Add whole menus for nodes associated with sections and without menu,
-based on the sectioning tree.  If the optional
-C<$add_section_names_in_entries> argument is set, a menu entry
+based on the sectioning tree.
+I<$customization_information>, if defined, should hold information
+needed for translations.  Translations are only needed when generating the
+top node menu.
+If the optional I<$add_section_names_in_entries> argument is set, a menu entry
 name is added using the section name.  This function should be
 called after L<sectioning_structure|Texinfo::Structuring/$sections_list = 
sectioning_structure($tree, $registrar, $customization_information)>.
 
diff --git a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs 
b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
index 66f3aea747..500fec3563 100644
--- a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+++ b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
@@ -231,8 +231,10 @@ complete_tree_nodes_menus (SV *tree_in, SV 
*use_sections_in=0)
         if (document)
           complete_tree_nodes_menus (document->tree, use_sections);
 
+# We use the options of the document, so we ignore
+# customization_information, which should contain the same information
 void
-complete_tree_nodes_missing_menu (SV *tree_in, SV *use_sections_in=0)
+complete_tree_nodes_missing_menu (SV *tree_in, SV 
*customization_information=0, SV *use_sections_in=0)
     PREINIT:
         DOCUMENT *document = 0;
         int use_sections = 0;
@@ -244,7 +246,8 @@ complete_tree_nodes_missing_menu (SV *tree_in, SV 
*use_sections_in=0)
             use_sections = SvIV (use_sections_in);
           }
         if (document)
-          complete_tree_nodes_missing_menu (document->tree, use_sections);
+          complete_tree_nodes_missing_menu (document->tree, document,
+                                            document->options, use_sections);
 
 # regenerate_master_menu uses the options of the document, so we ignore
 # customization_information, which should contain the same information
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c 
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index aa4b3691e0..d2021e556f 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -1773,8 +1773,45 @@ new_node_menu_entry (ELEMENT *node, int use_sections)
   return entry;
 }
 
+static void
+insert_menu_comment_content (ELEMENT_LIST *element_list, int position,
+                   ELEMENT *inserted_element, int no_leading_empty_line)
+{
+  ELEMENT *menu_comment = new_element (ET_menu_comment);
+  ELEMENT *preformatted = new_element (ET_preformatted);
+  ELEMENT *empty_line_first_after = new_element (ET_empty_line);
+  ELEMENT *empty_line_second_after = new_element (ET_empty_line);
+  int index_in_preformatted = 0;
+  int i;
+
+  add_to_element_contents (menu_comment, preformatted);
+
+  if (!no_leading_empty_line)
+    {
+      ELEMENT *empty_line_before = new_element (ET_empty_line);
+      text_append (&empty_line_before->text, "\n");
+      add_to_element_contents (preformatted, empty_line_before);
+      index_in_preformatted = 1;
+    }
+
+  for (i = 0; i < inserted_element->contents.number; i++)
+    inserted_element->contents.list[i]->parent = preformatted;
+
+  insert_slice_into_contents (preformatted, index_in_preformatted,
+                              inserted_element,
+                              0, inserted_element->contents.number);
+
+  text_append (&empty_line_first_after->text, "\n");
+  text_append (&empty_line_second_after->text, "\n");
+  add_to_element_contents (preformatted, empty_line_first_after);
+  add_to_element_contents (preformatted, empty_line_second_after);
+
+  insert_into_element_list (element_list, menu_comment, position);
+}
+
 ELEMENT *
-new_complete_node_menu (ELEMENT *node, int use_sections)
+new_complete_node_menu (ELEMENT *node, DOCUMENT *document,
+                        OPTIONS *options, int use_sections)
 {
   ELEMENT_LIST *node_childs = get_node_node_childs_from_sectioning (node);
   ELEMENT *section;
@@ -1803,6 +1840,79 @@ new_complete_node_menu (ELEMENT *node, int use_sections)
           add_to_element_contents (new_menu, entry);
         }
     }
+
+  if (section && section->cmd == CM_top && options)
+    {
+      char *normalized = lookup_extra_string (node, "normalized");
+      if (normalized && !strcmp (normalized, "Top"))
+        {
+          int content_index = 0;
+          int in_appendix = 0;
+          for (i = 0; i < node_childs->number; i++)
+            {
+              ELEMENT *child = node_childs->list[i];
+              int status;
+              int is_target = lookup_extra_integer (child, "is_target",
+                                                    &status);
+              ELEMENT *child_section;
+
+              if (!is_target)
+                continue;
+
+              child_section
+                  = lookup_extra_element (child, "associated_section");
+              if (child_section)
+                {
+                  int part_added = 0;
+                  ELEMENT *associated_part
+                    = lookup_extra_element (child, "associated_part");
+                  if (associated_part && associated_part->args.number > 0)
+                    {
+                      ELEMENT *part_title_copy
+                        = copy_tree (associated_part->args.list[0]);
+                      NAMED_STRING_ELEMENT_LIST *substrings
+                                       = new_named_string_element_list ();
+                      ELEMENT *part_title;
+                      add_element_to_named_string_element_list (substrings,
+                                                "part_title", part_title_copy);
+
+                      part_title
+                        = gdt_tree ("Part: {part_title}", document, options,
+                                    options->documentlanguage.string,
+                                    substrings, 0);
+
+                      insert_menu_comment_content (&new_menu->contents,
+                                                   content_index, part_title,
+                                                   (content_index == 0));
+                      destroy_element (part_title);
+
+                      content_index++;
+                      part_added = 1;
+                      destroy_named_string_element_list (substrings);
+                    }
+                  if (!in_appendix
+                      && command_other_flags (child_section) & CF_appendix)
+                    {
+                      ELEMENT *appendix_title
+                        = gdt_tree ("Appendices", document, options,
+                                    options->documentlanguage.string,
+                                    0, 0);
+
+                      insert_menu_comment_content (&new_menu->contents,
+                                                   content_index,
+                                                   appendix_title,
+                                         (content_index == 0 || part_added));
+                      destroy_element (appendix_title);
+
+                      content_index++;
+                      in_appendix++;
+                    }
+                }
+              content_index++;
+            }
+        }
+    }
+
   destroy_list (node_childs);
 
   new_block_command (new_menu, CM_menu);
@@ -1827,7 +1937,7 @@ print_down_menus (ELEMENT *node, LABEL_LIST 
*identifiers_target,
     {
       /* If there is no menu for the node, we create a temporary menu to be
          able to find and copy entries as if there was already a menu */
-      new_current_menu = new_complete_node_menu (node, use_sections);
+      new_current_menu = new_complete_node_menu (node, 0, 0, use_sections);
       if (new_current_menu)
         {
           menus = new_list ();
@@ -1870,11 +1980,6 @@ print_down_menus (ELEMENT *node, LABEL_LIST 
*identifiers_target,
     {
       ELEMENT *node_name_element;
       ELEMENT *node_title_copy;
-      ELEMENT *menu_comment = new_element (ET_menu_comment);
-      ELEMENT *preformatted = new_element (ET_preformatted);
-      ELEMENT *empty_line_before = new_element (ET_empty_line);
-      ELEMENT *empty_line_first_after = new_element (ET_empty_line);
-      ELEMENT *empty_line_second_after = new_element (ET_empty_line);
       ELEMENT *associated_section
        = lookup_extra_element (node, "associated_section");
       if (associated_section)
@@ -1884,23 +1989,10 @@ print_down_menus (ELEMENT *node, LABEL_LIST 
*identifiers_target,
 
       node_title_copy = copy_contents (node_name_element, ET_NONE);
 
-      for (i = 0; i < node_title_copy->contents.number; i++)
-        node_title_copy->contents.list[i]->parent = preformatted;
+      insert_menu_comment_content (master_menu_contents,
+                                   0, node_title_copy, 0);
 
-      add_to_element_contents (menu_comment, preformatted);
-
-      text_append (&empty_line_before->text, "\n");
-      text_append (&empty_line_first_after->text, "\n");
-      text_append (&empty_line_second_after->text, "\n");
-
-      add_to_element_contents (preformatted, empty_line_before);
-      insert_slice_into_contents (preformatted, 1, node_title_copy,
-                                  0, node_title_copy->contents.number);
       destroy_element (node_title_copy);
-      add_to_element_contents (preformatted, empty_line_first_after);
-      add_to_element_contents (preformatted, empty_line_second_after);
-
-      insert_into_element_list (master_menu_contents, menu_comment, 0);
 
       /* now recurse in the children */
       for (i = 0; i < node_children->number; i++)
@@ -2030,7 +2122,7 @@ new_complete_menu_master_menu (OPTIONS *options,
                                LABEL_LIST *identifiers_target,
                                ELEMENT *node)
 {
-  ELEMENT *menu_node = new_complete_node_menu (node, 0);
+  ELEMENT *menu_node = new_complete_node_menu (node, 0, options, 0);
 
   if (menu_node)
     {
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.h 
b/tp/Texinfo/XS/structuring_transfo/structuring.h
index febc3bf6e4..74e64120bd 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.h
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.h
@@ -18,7 +18,8 @@ void check_nodes_are_referenced (DOCUMENT *document);
 void number_floats (DOCUMENT *document);
 
 ELEMENT *new_node_menu_entry (ELEMENT *node, int use_sections);
-ELEMENT *new_complete_node_menu (ELEMENT *node, int use_sections);
+ELEMENT *new_complete_node_menu (ELEMENT *node, DOCUMENT *document,
+                                 OPTIONS *options, int use_sections);
 void new_block_command (ELEMENT *element, enum command_id cmd);
 ELEMENT *new_master_menu (OPTIONS *options, LABEL_LIST *identifiers_target,
                           const ELEMENT_LIST *menus, int use_sections);
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c 
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index daf9e1afae..9dac12ee4f 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -1094,7 +1094,8 @@ complete_tree_nodes_menus (ELEMENT *root, int 
use_sections)
 }
 
 void
-complete_tree_nodes_missing_menu (ELEMENT *root, int use_sections)
+complete_tree_nodes_missing_menu (ELEMENT *root, DOCUMENT *document,
+                                  OPTIONS *options, int use_sections)
 {
   ELEMENT_LIST *non_automatic_nodes
      = get_non_automatic_nodes_with_sections (root);
@@ -1106,7 +1107,8 @@ complete_tree_nodes_missing_menu (ELEMENT *root, int 
use_sections)
       if (!(menus && menus->number > 0))
         {
           ELEMENT *section = lookup_extra_element (node, "associated_section");
-          ELEMENT *current_menu = new_complete_node_menu (node, use_sections);
+          ELEMENT *current_menu = new_complete_node_menu (node, document,
+                                                      options, use_sections);
           if (current_menu)
             prepend_new_menu_in_node_section (node, section, current_menu);
         }
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.h 
b/tp/Texinfo/XS/structuring_transfo/transformations.h
index efaab3d6b8..9fe00fbb05 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.h
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.h
@@ -14,7 +14,8 @@ ELEMENT *reference_to_arg_in_tree (ELEMENT *tree, DOCUMENT 
*document);
 ELEMENT *protect_comma_in_tree (ELEMENT *tree);
 ELEMENT *protect_node_after_label_in_tree (ELEMENT *tree);
 void complete_tree_nodes_menus (ELEMENT *root, int use_sections);
-void complete_tree_nodes_missing_menu (ELEMENT *root, int use_sections);
+void complete_tree_nodes_missing_menu (ELEMENT *root, DOCUMENT *document,
+                                       OPTIONS *options, int use_sections);
 int regenerate_master_menu (DOCUMENT *document, int use_sections);
 ELEMENT_LIST *insert_nodes_for_sectioning_commands (DOCUMENT *document);
 ELEMENT *protect_hashchar_at_line_beginning (DOCUMENT *document);
diff --git a/tp/t/automatic_menus.t b/tp/t/automatic_menus.t
index 8934574c36..417c94a6ec 100644
--- a/tp/t/automatic_menus.t
+++ b/tp/t/automatic_menus.t
@@ -34,7 +34,7 @@ sub test($$$;$$)
 
   Texinfo::Structuring::sectioning_structure($tree, $registrar, $parser);
   if ($complete_missing_menus) {
-    Texinfo::Transformations::complete_tree_nodes_missing_menu($tree,
+    Texinfo::Transformations::complete_tree_nodes_missing_menu($tree, undef,
                                                                $use_sections);
     #print STDERR "".Texinfo::Common::debug_print_tree($tree)."\n";
   } else {
diff --git a/tp/t/results/indices/index_entry_in_footnote_sections.pl 
b/tp/t/results/indices/index_entry_in_footnote_sections.pl
index a5e0f85c5b..2e5e2d792b 100644
--- a/tp/t/results/indices/index_entry_in_footnote_sections.pl
+++ b/tp/t/results/indices/index_entry_in_footnote_sections.pl
@@ -427,6 +427,8 @@ Top node(1)
 
 * Menu:
 
+Appendices
+
 * Index::
 
    ---------- Footnotes ----------
@@ -444,13 +446,13 @@ Appendix A index
 [index]
 * Menu:
 
-* index entry in footnote:               Top.                  (line 16)
+* index entry in footnote:               Top.                  (line 18)
 
 
 Tag Table:
 Node: Top27
-Ref: Top-Footnote-1193
-Node: Index243
+Ref: Top-Footnote-1205
+Node: Index255
 
 End Tag Table
 
diff --git a/tp/t/results/indices/index_entry_in_footnote_sections_separate.pl 
b/tp/t/results/indices/index_entry_in_footnote_sections_separate.pl
index 91abecd206..f18148e264 100644
--- a/tp/t/results/indices/index_entry_in_footnote_sections_separate.pl
+++ b/tp/t/results/indices/index_entry_in_footnote_sections_separate.pl
@@ -427,6 +427,8 @@ Top node(1) (*note Top-Footnote-1::)
 
 * Menu:
 
+Appendices
+
 * Index::
 
 
@@ -450,9 +452,9 @@ Appendix A index
 
 Tag Table:
 Node: Top27
-Node: Top-Footnotes182
-Ref: Top-Footnote-1224
-Node: Index274
+Node: Top-Footnotes194
+Ref: Top-Footnote-1236
+Node: Index286
 
 End Tag Table
 
diff --git 
a/tp/t/results/indices/index_special_region/res_info/index_special_region.info 
b/tp/t/results/indices/index_special_region/res_info/index_special_region.info
index f31db6c01e..c2ae006f84 100644
Binary files 
a/tp/t/results/indices/index_special_region/res_info/index_special_region.info 
and 
b/tp/t/results/indices/index_special_region/res_info/index_special_region.info 
differ
diff --git 
a/tp/t/results/indices/index_special_region_no_insertcopying/res_info/index_special_region_no_insertcopying.info
 
b/tp/t/results/indices/index_special_region_no_insertcopying/res_info/index_special_region_no_insertcopying.info
index ef15ada927..0848cacc8f 100644
Binary files 
a/tp/t/results/indices/index_special_region_no_insertcopying/res_info/index_special_region_no_insertcopying.info
 and 
b/tp/t/results/indices/index_special_region_no_insertcopying/res_info/index_special_region_no_insertcopying.info
 differ
diff --git 
a/tp/t/results/indices/index_special_region_no_insertcopying_titlepage_no_nodes/res_info/index_special_region_no_insertcopying.info
 
b/tp/t/results/indices/index_special_region_no_insertcopying_titlepage_no_nodes/res_info/index_special_region_no_insertcopying.info
index ef15ada927..0848cacc8f 100644
Binary files 
a/tp/t/results/indices/index_special_region_no_insertcopying_titlepage_no_nodes/res_info/index_special_region_no_insertcopying.info
 and 
b/tp/t/results/indices/index_special_region_no_insertcopying_titlepage_no_nodes/res_info/index_special_region_no_insertcopying.info
 differ
diff --git 
a/tp/t/results/indices/index_special_region_titlepage_no_nodes/res_info/index_special_region.info
 
b/tp/t/results/indices/index_special_region_titlepage_no_nodes/res_info/index_special_region.info
index 7602673994..02ed0cab1a 100644
Binary files 
a/tp/t/results/indices/index_special_region_titlepage_no_nodes/res_info/index_special_region.info
 and 
b/tp/t/results/indices/index_special_region_titlepage_no_nodes/res_info/index_special_region.info
 differ
diff --git a/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl 
b/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl
index b052646f79..04cea3cc25 100644
--- a/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl
+++ b/tp/t/results/sectioning/chapter_between_nodes_with_appendix.pl
@@ -446,6 +446,8 @@ top section
 
 * Menu:
 
+Appendices
+
 * Additional::
 
 1 Main
@@ -466,7 +468,7 @@ Appendix A Annex
 
 Tag Table:
 Node: Top27
-Node: Additional180
+Node: Additional192
 
 End Tag Table
 
diff --git 
a/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl 
b/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl
index 282c1ca67b..4ba356ee22 100644
--- a/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl
+++ b/tp/t/results/sectioning/chapter_between_nodes_with_appendix_nomenu.pl
@@ -440,6 +440,8 @@ top section
 
 * Menu:
 
+Appendices
+
 * Additional::
 
 1 Main
@@ -460,7 +462,7 @@ Appendix A Annex
 
 Tag Table:
 Node: Top27
-Node: Additional161
+Node: Additional173
 
 End Tag Table
 
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 681ae6154e..906fb2cee9 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -1109,7 +1109,8 @@ sub test($$)
   if ($tree_transformations{'complete_tree_nodes_menus'}) {
     Texinfo::Transformations::complete_tree_nodes_menus($tree);
   } elsif ($tree_transformations{'complete_tree_nodes_missing_menu'}) {
-    Texinfo::Transformations::complete_tree_nodes_missing_menu($tree);
+    Texinfo::Transformations::complete_tree_nodes_missing_menu($tree,
+                                                     $main_configuration);
   }
 
   if ($tree_transformations{'regenerate_master_menu'}) {
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index d2e807810a..eb0d291374 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1635,7 +1635,8 @@ while(@input_files) {
   if ($tree_transformations{'complete_tree_nodes_menus'}) {
     Texinfo::Transformations::complete_tree_nodes_menus($tree);
   } elsif ($tree_transformations{'complete_tree_nodes_missing_menu'}) {
-    Texinfo::Transformations::complete_tree_nodes_missing_menu($tree);
+    Texinfo::Transformations::complete_tree_nodes_missing_menu($tree,
+                                                    $main_configuration);
   }
 
   if ($tree_transformations{'regenerate_master_menu'}) {



reply via email to

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