texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Structuring.pm, * tp/Texinfo/Common.


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Structuring.pm, * tp/Texinfo/Common.pm (_normalized_entry_associated_internal_node): Remove duplicate definition in Structuring.pm, using the definition in Common.pm instead.
Date: Fri, 04 Aug 2023 11:34:15 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a274d6ece7 * tp/Texinfo/Structuring.pm, * tp/Texinfo/Common.pm 
(_normalized_entry_associated_internal_node): Remove duplicate definition in 
Structuring.pm, using the definition in Common.pm instead.
a274d6ece7 is described below

commit a274d6ece7b521596eb0b2539c66c52ab20b29ad
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Aug 4 16:34:07 2023 +0100

    * tp/Texinfo/Structuring.pm,
    * tp/Texinfo/Common.pm (_normalized_entry_associated_internal_node):
    Remove duplicate definition in Structuring.pm, using the definition
    in Common.pm instead.
---
 ChangeLog                     |  7 +++++++
 tp/Texinfo/Common.pm          |  3 ++-
 tp/Texinfo/Transformations.pm | 25 +------------------------
 3 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8eb51ae0c1..bc3094ed9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-04  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Structuring.pm,
+       * tp/Texinfo/Common.pm (_normalized_entry_associated_internal_node):
+       Remove duplicate definition in Structuring.pm, using the definition
+       in Common.pm instead.
+
 2023-08-04  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/Common.pm (new_master_menu): Always take an array
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index a1f3d8f58b..d74833c52b 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1946,7 +1946,8 @@ sub _collect_commands_list_in_tree($$$)
   }
 }
 
-# NB duplicated from Texinfo::Transformations
+# Return ($NORMALIZED_ENTRY_NODE, $NODE) where $NODE is the node referred to
+# by menu entry $ENTRY, and $NORMALIZED_ENTRY_NODE is the name of this node.
 sub _normalized_entry_associated_internal_node($;$)
 {
   my $entry = shift;
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index 030f903988..b965a8fee7 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -412,7 +412,7 @@ sub complete_node_menu($;$)
         foreach my $entry (@{$menu->{'contents'}}) {
           if ($entry->{'type'} and $entry->{'type'} eq 'menu_entry') {
             my ($normalized_entry_node, $node)
-              = _normalized_entry_associated_internal_node($entry);
+              = 
Texinfo::Common::_normalized_entry_associated_internal_node($entry);
             if (defined($normalized_entry_node)) {
               $existing_entries{$normalized_entry_node}
                 = [$menu, $entry];
@@ -522,29 +522,6 @@ sub complete_tree_nodes_missing_menu($;$)
   }
 }
 
-sub _normalized_entry_associated_internal_node($;$)
-{
-  my $entry = shift;
-  my $labels = shift;
-
-  foreach my $arg (@{$entry->{'contents'}}) {
-    if ($arg->{'type'} eq 'menu_entry_node') {
-      if (! $arg->{'extra'}->{'manual_content'}) {
-        my $normalized_entry_node = $arg->{'extra'}->{'normalized'};
-        if (defined($normalized_entry_node)) {
-          if ($labels) {
-            return ($normalized_entry_node, $labels->{$normalized_entry_node});
-          } else {
-            return ($normalized_entry_node, undef);
-          }
-        }
-      }
-      last;
-    }
-  }
-  return (undef, undef);
-}
-
 # self is used to pass down a translatable object with customization
 # information for the gdt() call.
 sub regenerate_master_menu($$)



reply via email to

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