texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Fri, 4 Aug 2023 08:16:19 -0400 (EDT)

branch: master
commit a5ce695c7c8d22258ae0e5dc1b150aa26a53096e
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Aug 4 12:36:44 2023 +0100

    * tp/Texinfo/Common.pm (_print_down_menus):
    Call Texinfo::Structuring:::new_complete_node_menu in order to output
    part of the master menu when a node is missing a @menu block.
---
 ChangeLog            |  6 ++++++
 tp/Texinfo/Common.pm | 17 +++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 071898d5d0..484cc92bba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-08-04  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Common.pm (_print_down_menus):
+       Call Texinfo::Structuring:::new_complete_node_menu in order to output
+       part of the master menu when a node is missing a @menu block.
+
 2023-08-04  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/Common.pm (%valid_tree_transformations):
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 1bbc8098f9..7a4136fc45 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -2016,12 +2016,25 @@ sub _print_down_menus($$)
 {
   my $node = shift;
   my $labels = shift;
+  my @menus;
+
+  if ($node->{'extra'}->{'menus'}
+        and scalar(@{$node->{'extra'}->{'menus'}})) {
+    @menus = @{$node->{'extra'}->{'menus'}};
+  } else {
+    my $section = $node->{'extra'}->{'associated_section'};
+    my $current_menu
+      = Texinfo::Structuring::new_complete_node_menu($node, undef);
+    if (defined($current_menu)) {
+      @menus = ( $current_menu );
+    }
+  }
 
   my @master_menu_contents;
 
-  if ($node->{'extra'}->{'menus'} and scalar(@{$node->{'extra'}->{'menus'}})) {
+  if (@menus) {
     my @node_children;
-    foreach my $menu (@{$node->{'extra'}->{'menus'}}) {
+    foreach my $menu (@menus) {
       foreach my $entry (@{$menu->{'contents'}}) {
         if ($entry->{'type'} and $entry->{'type'} eq 'menu_entry') {
           push @master_menu_contents, Texinfo::Common::copy_tree($entry);



reply via email to

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