texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Remove AVOID_MENU_REDUNDANCY customization option


From: Patrice Dumas
Subject: branch master updated: Remove AVOID_MENU_REDUNDANCY customization option
Date: Tue, 02 Apr 2024 16:56:01 -0400

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

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new fc0223d6e1 Remove AVOID_MENU_REDUNDANCY customization option
fc0223d6e1 is described below

commit fc0223d6e182f91bd0677448c16a82c7fad53c16
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Apr 2 22:55:49 2024 +0200

    Remove AVOID_MENU_REDUNDANCY customization option
    
    * NEWS, doc/texinfo.texi (HTML Customization Variables List),
    tp/Texinfo/Convert/HTML.pm (%defaults, _convert_menu_entry_type),
    tp/Texinfo/XS/convert/convert_html.c (simplify_text_for_comparison)
    (convert_menu_entry_type), tp/Texinfo/options_data.txt: remove
    AVOID_MENU_REDUNDANCY customization variable.  The associated
    case is unlikely to happen, not important, and the user can easily
    avoid the need for the variable by leaving the menu description blank.
---
 ChangeLog                                          | 12 +++++
 NEWS                                               |  1 +
 doc/texinfo.texi                                   |  7 ---
 tp/Texinfo/Convert/HTML.pm                         |  8 ----
 tp/Texinfo/XS/convert/convert_html.c               | 52 +---------------------
 tp/Texinfo/options_data.txt                        |  1 -
 .../res_parser/formatting_fr/formatting.html       |  3 +-
 .../res_parser/formatting_fr_icons/formatting.html |  3 +-
 .../formatting_texi2html/formatting.html           |  3 +-
 .../formatting_texi2html_nodes/index.html          |  3 +-
 .../res_parser/formatting_singular/index.htm       |  3 +-
 11 files changed, 25 insertions(+), 71 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa8b1903c4..df44defeae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-04-02  Patrice Dumas  <pertusus@free.fr>
+
+       Remove AVOID_MENU_REDUNDANCY customization option
+
+       * NEWS, doc/texinfo.texi (HTML Customization Variables List),
+       tp/Texinfo/Convert/HTML.pm (%defaults, _convert_menu_entry_type),
+       tp/Texinfo/XS/convert/convert_html.c (simplify_text_for_comparison)
+       (convert_menu_entry_type), tp/Texinfo/options_data.txt: remove
+       AVOID_MENU_REDUNDANCY customization variable.  The associated
+       case is unlikely to happen, not important, and the user can easily
+       avoid the need for the variable by leaving the menu description blank.
+
 2024-04-02  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.texi (EPUB HTML): Add a @nodedescription.  Make
diff --git a/NEWS b/NEWS
index 16938ca73e..fc398f6174 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ See the manual for detailed information.
    use of Unicode collation when sorting indices
  . remove SIMPLE_MENU customization option and tree transformation.
  . remove FRAMES and FRAMESET_DOCTYPE customization options.
+ . remove AVOID_MENU_REDUNDANCY customization option.
  . set CHECK_NORMAL_MENU_STRUCTURE in the default case.
  . some unused translation files have been removed for the
    "texinfo_document" domain
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index 918a3bfd52..25b8bfac7e 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -18505,9 +18505,6 @@ name and miscellaneous related information in About 
special element;
 default false.
 @end vtable
 
-@c proposal to be removed
-@c AVOID_MENU_REDUNDANCY
-
 
 @node HTML Customization for Math
 @subsection HTML Customization for Math
@@ -18692,10 +18689,6 @@ defined.
 This table lists the customization variables which apply to HTML output.
 
 @vtable @code
-@item AVOID_MENU_REDUNDANCY
-If set, and the menu entry and menu description are the
-same, then do not print the menu description; default false.
-
 @item AFTER_BODY_OPEN
 Text added at the beginning of each HTML file; default unset.
 
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 31398cf2df..d3eaaee992 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -2420,7 +2420,6 @@ my %defaults = (
   'converted_format'   => 'html',
 
   # Customization option variables
-  'AVOID_MENU_REDUNDANCY' => 0,
   'BIG_RULE'              => '<hr>',
   'BODYTEXT'              => undef,
   'CHAPTER_HEADER_LEVEL'  => 2,
@@ -7635,12 +7634,6 @@ sub _convert_menu_entry_type($$$)
     $description = $self->convert_tree($menu_description,
                                          'menu_arg description');
   }
-  if ($description ne ''
-      and $self->get_conf('AVOID_MENU_REDUNDANCY')
-      and _simplify_text_for_comparison($name_no_number)
-            eq _simplify_text_for_comparison($description)) {
-    $description = '';
-  }
   my $non_breaking_space = $self->get_info('non_breaking_space');
   return '<tr>'
      .$self->html_attribute_class('td', ['menu-entry-destination']).'>'
@@ -13610,7 +13603,6 @@ sub _set_variables_texi2html($)
   ['footnotestyle', 'separate'],
   ['CONTENTS_OUTPUT_LOCATION', 'separate_element'],
   ['FORCE', 1],
-  ['AVOID_MENU_REDUNDANCY', 1],
   ['USE_ACCESSKEY', 0],
   ['NODE_NAME_IN_MENU', 0],
   ['SHORT_TOC_LINK_TO_TOC', 0],
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index a52a6b880e..781a397a55 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -14183,36 +14183,6 @@ menu_entry_a (const CONVERTER *self, const char *href, 
int isindex,
   text_append_n (result, ">", 1);
 }
 
-static char *
-simplify_text_for_comparison (const char *text)
-{
-  TEXT result;
-  text_init (&result);
-  text_append (&result, "");
-
-  const char *p = text;
-
-  while (*p)
-    {
-      int w_len = word_bytes_len_multibyte (p);
-      if (w_len)
-        {
-          text_append_n (&result, p, w_len);
-          p += w_len;
-        }
-      else if (*p)
-        {
-          /* skip a character */
-          int char_len = 1;
-          while ((p[char_len] & 0xC0) == 0x80)
-            char_len++;
-          p += char_len;
-        }
-    }
-
-  return result.text;
-}
-
 void
 convert_menu_entry_type (CONVERTER *self, const enum element_type type,
                   const ELEMENT *element, const char *content,
@@ -14607,26 +14577,8 @@ convert_menu_entry_type (CONVERTER *self, const enum 
element_type type,
 
       if (description)
         {
-          if (strlen (description)
-              && self->conf->AVOID_MENU_REDUNDANCY.integer > 0)
-            {
-              char *simplified_name_no_number
-               = simplify_text_for_comparison (name_no_number);
-              char *simplified_description
-               = simplify_text_for_comparison (description);
-              if (!strcmp (simplified_name_no_number, simplified_description))
-                {
-                  free (description);
-                  description = 0;
-                }
-              free (simplified_name_no_number);
-              free (simplified_description);
-            }
-          if (description)
-            {
-              text_append (result, description);
-              free (description);
-            }
+          text_append (result, description);
+          free (description);
         }
 
       free (name_no_number);
diff --git a/tp/Texinfo/options_data.txt b/tp/Texinfo/options_data.txt
index 7877687655..6f86914da5 100644
--- a/tp/Texinfo/options_data.txt
+++ b/tp/Texinfo/options_data.txt
@@ -201,7 +201,6 @@ ASCII_GLYPH                        converter_customization 
undef   integer
 ASCII_PUNCTUATION                  converter_customization undef   integer
 AUTO_MENU_DESCRIPTION_ALIGN_COLUMN converter_customization undef   integer
 AUTO_MENU_MAX_WIDTH                converter_customization undef   integer
-AVOID_MENU_REDUNDANCY              converter_customization undef   integer
 BEFORE_SHORT_TOC_LINES             converter_customization undef   char
 BEFORE_TOC_LINES                   converter_customization undef   char
 BIG_RULE                           converter_customization undef   char
diff --git a/tp/tests/layout/res_parser/formatting_fr/formatting.html 
b/tp/tests/layout/res_parser/formatting_fr/formatting.html
index 926d42340e..4339218d02 100644
--- a/tp/tests/layout/res_parser/formatting_fr/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_fr/formatting.html
@@ -3151,7 +3151,8 @@ html ''
 <h1 class="top" id="Top-section"><span>Top section<a class="copiable-link" 
href="#Top-section"> &para;</a></span></h1>
 
 <table class="menu" border="0" cellspacing="0">
-<tr><td class="menu-entry-destination"><a href="#chapter" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td 
class="menu-entry-description"></td></tr>
+<tr><td class="menu-entry-destination"><a href="#chapter" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td class="menu-entry-description">chapter
+</td></tr>
 <tr><th class="menu-comment" colspan="3"><pre 
class="menu-comment-preformatted">
 
 Menu comment
diff --git a/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html 
b/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html
index 70dccf444d..a21889dd6c 100644
--- a/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_fr_icons/formatting.html
@@ -3151,7 +3151,8 @@ html ''
 <h1 class="top" id="Top-section"><span>Top section<a class="copiable-link" 
href="#Top-section"> &para;</a></span></h1>
 
 <table class="menu" border="0" cellspacing="0">
-<tr><td class="menu-entry-destination"><a href="#chapter" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td 
class="menu-entry-description"></td></tr>
+<tr><td class="menu-entry-destination"><a href="#chapter" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td class="menu-entry-description">chapter
+</td></tr>
 <tr><th class="menu-comment" colspan="3"><pre 
class="menu-comment-preformatted">
 
 Menu comment
diff --git a/tp/tests/layout/res_parser/formatting_texi2html/formatting.html 
b/tp/tests/layout/res_parser/formatting_texi2html/formatting.html
index 08796838a3..104625df43 100644
--- a/tp/tests/layout/res_parser/formatting_texi2html/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_texi2html/formatting.html
@@ -3151,7 +3151,8 @@ html ''
 <h1 class="top" id="Top-section"><span>Top section<a class="copiable-link" 
href="#Top-section"> &para;</a></span></h1>
 
 <table class="menu" border="0" cellspacing="0">
-<tr><td class="menu-entry-destination"><a href="#chapter" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td 
class="menu-entry-description"></td></tr>
+<tr><td class="menu-entry-destination"><a href="#chapter" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td class="menu-entry-description">chapter
+</td></tr>
 <tr><th class="menu-comment" colspan="3"><pre 
class="menu-comment-preformatted">
 
 Menu comment
diff --git a/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html 
b/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html
index b3297dbbc0..c2724fbffb 100644
--- a/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html
+++ b/tp/tests/layout/res_parser/formatting_texi2html_nodes/index.html
@@ -3138,7 +3138,8 @@ html ''
 <h1 class="top" id="Top-section"><span>Top section<a class="copiable-link" 
href="#Top-section"> &para;</a></span></h1>
 
 <table class="menu" border="0" cellspacing="0">
-<tr><td class="menu-entry-destination"><a href="chapter.html" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td 
class="menu-entry-description"></td></tr>
+<tr><td class="menu-entry-destination"><a href="chapter.html" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td class="menu-entry-description">chapter
+</td></tr>
 <tr><th class="menu-comment" colspan="3"><pre 
class="menu-comment-preformatted">
 
 Menu comment
diff --git a/tp/tests/tex_html/res_parser/formatting_singular/index.htm 
b/tp/tests/tex_html/res_parser/formatting_singular/index.htm
index 74a9c96d43..0e60e707cd 100644
--- a/tp/tests/tex_html/res_parser/formatting_singular/index.htm
+++ b/tp/tests/tex_html/res_parser/formatting_singular/index.htm
@@ -924,7 +924,8 @@ th.menu-comment {text-align:left}
 <h1 class="top" id="Top-section"><span>Top section<a class="copiable-link" 
href="#Top-section"> &para;</a></span></h1>
 
 <blockquote><table class="menu" border="0" cellspacing="0">
-<tr><td class="menu-entry-destination"><a href="chapter.html" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td 
class="menu-entry-description"></td></tr>
+<tr><td class="menu-entry-destination"><a href="chapter.html" rel="index">1 
chapter</a></td><td>&nbsp;&nbsp;</td><td class="menu-entry-description">chapter
+</td></tr>
 <tr><th class="menu-comment" colspan="3"><pre 
class="menu-comment-preformatted">
 
 Menu comment



reply via email to

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