texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Remove relate_index_entries_to_table_entries_in_t


From: Gavin D. Smith
Subject: branch master updated: Remove relate_index_entries_to_table_entries_in_tree
Date: Sat, 26 Nov 2022 11:38:53 -0500

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 bccbd7e4d6 Remove relate_index_entries_to_table_entries_in_tree
bccbd7e4d6 is described below

commit bccbd7e4d6f71774a22e3be6e7a61326b0cd6ee0
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Nov 26 16:38:26 2022 +0000

    Remove relate_index_entries_to_table_entries_in_tree
    
    * tp/Texinfo/Common.pm (texinfo_special_joint_transformation)
    (relate_index_entries_to_table_entries_in_tree): Remove.
    * tp/texi2any.pl: Do not use relate_index_entries_to_table_entries
    transformation for HTML or LaTeX.
---
 ChangeLog            |  9 ++++++
 tp/Texinfo/Common.pm | 86 ----------------------------------------------------
 tp/texi2any.pl       | 15 ++-------
 3 files changed, 11 insertions(+), 99 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index adb6e4f03e..f920069706 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-11-26  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Remove relate_index_entries_to_table_entries_in_tree
+
+       * tp/Texinfo/Common.pm (texinfo_special_joint_transformation)
+       (relate_index_entries_to_table_entries_in_tree): Remove.
+       * tp/texi2any.pl: Do not use relate_index_entries_to_table_entries
+       transformation for HTML or LaTeX.
+
 2022-11-26  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (_convert_table_term_type): add the
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index f819f35434..a02cf6fca4 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -58,7 +58,6 @@ protect_colon_in_tree
 protect_comma_in_tree
 protect_first_parenthesis
 protect_node_after_label_in_tree
-relate_index_entries_to_table_entries_in_tree
 valid_customization_option
 valid_tree_transformation
 ) ] );
@@ -2177,84 +2176,6 @@ sub move_index_entries_after_items_in_tree($)
   return modify_tree($tree, \&_move_index_entries_after_items);
 }
 
-sub _relate_index_entry_to_table_entry($)
-{
-  my $current = shift; # table_entry
-
-  my ($table_term, $table_definition, $item);
-
-  if ($current->{'contents'}
-        and $current->{'contents'}->[0]
-        and $current->{'contents'}->[0]->{'type'} eq 'table_term') {
-    $table_term = $current->{'contents'}->[0];
-  }
-
-  if ($current->{'contents'}
-        and $current->{'contents'}->[1]
-        and $current->{'contents'}->[1]->{'type'} eq 'table_definition') {
-    $table_definition = $current->{'contents'}->[1];
-  }
-
-  if ($table_term->{'contents'}
-    and $table_term->{'contents'}->[0]
-    and (!$table_term->{'contents'}->[0]->{'extra'}
-          or !$table_term->{'contents'}->[0]->{'extra'}->{'index_entry'})) {
-    $item = $table_term->{'contents'}->[0];
-  }
-
-  return if !$table_term or !$table_definition or !$item;
-
-  if ($table_definition->{'contents'}
-    and $table_definition->{'contents'}->[0]
-    and $table_definition->{'contents'}->[0]->{'type'}
-    and $table_definition->{'contents'}->[0]->{'type'} eq 
'index_entry_command') {
-      my $index_command = shift @{$table_definition->{'contents'}};
-      delete $index_command->{'parent'};
-      $item->{'extra'}->{'index_entry'}
-        = $index_command->{'extra'}->{'index_entry'};
-      $item->{'extra'}->{'index_entry'}->{'entry_element'} = $item;
-  }
-}
-
-sub _relate_index_entries_to_table_entries_in_tree($$)
-{
-  my ($type, $current) = @_;
-
-  if ($current->{'type'} and ($current->{'type'} eq 'table_entry')) {
-    _relate_index_entry_to_table_entry($current);
-  }
-  return ($current);
-}
-
-sub relate_index_entries_to_table_entries_in_tree($)
-{
-  my $tree = shift;
-  return modify_tree($tree,
-                     \&_relate_index_entries_to_table_entries_in_tree);
-}
-
-
-# Used in the main program, not meant to be used in user-defined code.
-sub _special_joint_transformation($)
-{
-  my $type = shift;
-  my $current = shift;
-
-  _move_index_entries_after_items($type, $current);
-  _relate_index_entries_to_table_entries_in_tree($type, $current);
-  return ($current);
-}
-
-# Peform both the 'move_index_entries_after_items' and the
-# 'relate_index_entries_to_table_entries_in_tree' transformations
-# together.  This is faster because the tree is only traversed once.
-sub texinfo_special_joint_transformation($)
-{
-  my $tree = shift;
-  return modify_tree($tree, \&_special_joint_transformation);
-}
-
-
 # Common to different module, but not meant to be used in user-defined
 # codes.
 #
@@ -2658,13 +2579,6 @@ Return a contents array reference with first parenthesis 
in the
 contents array reference protected.  If I<$contents> is undef
 a fatal error with a backtrace will be emitted.
 
-=item relate_index_entries_to_table_entries_in_tree($tree)
-X<C<relate_index_entries_to_table_entries_in_tree>>
-
-In @*table @-commands, reassociate the index entry information from an index
-@-command appearing right after an @item line to the @item first element.
-Remove the index @-command from the tree.
-
 =item $level = section_level($section)
 X<C<section_level>>
 
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 4c95e54074..3ab174d718 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -588,15 +588,14 @@ my %formats_table = (
              'split' => 1,
              'internal_links' => 1,
              'simple_menu' => 1,
-  # move_index_entries_after_items + relate_index_entries_to_table_entries
-             'joint_transformation' => 1,
+             'move_index_entries_after_items' => 1,
              'no_warn_non_empty_parts' => 1,
              'module' => 'Texinfo::Convert::HTML'
            },
   'latex' => {
              'floats' => 1,
              'internal_links' => 1,
-             'joint_transformation' => 1,
+             'move_index_entries_after_items' => 1,
              'no_warn_non_empty_parts' => 1,
              'module' => 'Texinfo::Convert::LaTeX'
            },
@@ -1483,16 +1482,6 @@ while(@input_files) {
     Texinfo::Common::move_index_entries_after_items_in_tree($tree);
   }
 
-  if 
($formats_table{$converted_format}->{'relate_index_entries_to_table_entries'}
-      or $tree_transformations{'relate_index_entries_to_table_entries'}) {
-    Texinfo::Common::relate_index_entries_to_table_entries_in_tree($tree);
-  }
-
-  # move_index_entries_after_items + relate_index_entries_to_table_entries
-  if ($formats_table{$converted_format}->{'joint_transformation'}) {
-    Texinfo::Common::texinfo_special_joint_transformation($tree);
-  }
-
   if ($tree_transformations{'insert_nodes_for_sectioning_commands'}) {
     my ($modified_contents, $added_nodes)
      = Texinfo::Transformations::insert_nodes_for_sectioning_commands(



reply via email to

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