texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Wed, 15 Jan 2025 18:18:42 -0500 (EST)

branch: master
commit 97baffad20edf056bc99ad5e803b0b6265780788
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jan 16 00:18:42 2025 +0100

    Remove the direction and text type for a button
    
    * tp/Texinfo/Convert/HTML.pm (_default_format_button),
    tp/Texinfo/XS/convert/format_html.c (html_default_format_button),
    tp/Texinfo/XS/main/create_buttons.c (new_button_specification),
    tp/Texinfo/XS/main/get_perl_info.c
    (html_get_button_specification_list),
    tp/Texinfo/XS/main/option_types.h (enum button_specification_type):
    remove the button formatting using a two element array with direction
    and text type.  It was already unused, undocumented and scheduled for
    deletion.
---
 ChangeLog                                  | 14 ++++++++++++++
 tp/Texinfo/Convert/HTML.pm                 | 12 ------------
 tp/Texinfo/XS/convert/format_html.c        | 23 -----------------------
 tp/Texinfo/XS/main/build_perl_info.c       |  7 ++-----
 tp/Texinfo/XS/main/create_buttons.c        |  3 +--
 tp/Texinfo/XS/main/customization_options.c |  3 +--
 tp/Texinfo/XS/main/get_perl_info.c         |  6 ------
 tp/Texinfo/XS/main/option_types.h          |  1 -
 8 files changed, 18 insertions(+), 51 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9062d88c1a..101886939d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-01-15  Patrice Dumas  <pertusus@free.fr>
+
+       Remove the direction and text type for a button
+
+       * tp/Texinfo/Convert/HTML.pm (_default_format_button),
+       tp/Texinfo/XS/convert/format_html.c (html_default_format_button),
+       tp/Texinfo/XS/main/create_buttons.c (new_button_specification),
+       tp/Texinfo/XS/main/get_perl_info.c
+       (html_get_button_specification_list),
+       tp/Texinfo/XS/main/option_types.h (enum button_specification_type):
+       remove the button formatting using a two element array with direction
+       and text type.  It was already unused, undocumented and scheduled for
+       deletion.
+
 2025-01-15  Patrice Dumas  <pertusus@free.fr>
 
        Remove the possibility to use a direction and scalar reference for a 
button
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 2afcf19e28..a6a1656730 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -4114,18 +4114,6 @@ sub _default_format_button($$;$)
         # with the direction $direction
         $active = $self->from_element_direction($direction, $text,
                                                 undef, undef, $source_command);
-      } else {
-        # NOTE This buttons specification is not used anywhere in code nor
-        # tests, it is certainly not worth maintaining in the long run.
-        my $href = $self->from_element_direction($direction, 'href',
-                                                 undef, undef, 
$source_command);
-        my $text_formatted = $self->from_element_direction($direction, $text);
-        if (defined($href) and defined($text_formatted)) {
-          my $anchor_attributes = 
$self->_direction_href_attributes($direction);
-          $active = "<a 
href=\"$href\"${anchor_attributes}>$text_formatted</a>";
-        } else {
-          $passive = $text_formatted;
-        }
       }
       $need_delimiter = 1;
     }
diff --git a/tp/Texinfo/XS/convert/format_html.c 
b/tp/Texinfo/XS/convert/format_html.c
index 219956df36..d007b4abea 100644
--- a/tp/Texinfo/XS/convert/format_html.c
+++ b/tp/Texinfo/XS/convert/format_html.c
@@ -4332,29 +4332,6 @@ html_default_format_button (CONVERTER *self,
                          button->b.button_info->bi.direction_information_type,
                                                            0, 0, element);
             }
-          else if (button->b.button_info->type
-                   == BIT_href_direction_information_type)
-            {
-              char *href = from_element_direction (self, direction,
-                                                   HTT_href, 0, 0, element);
-              if (button->b.button_info->bi.direction_information_type >= 0)
-                {
-                  char *text_formatted = from_element_direction (self,
-                                                                 direction,
-                        button->b.button_info->bi.direction_information_type,
-                                                                 0, 0, 0);
-                  if (href && text_formatted)
-                    {
-                      formatted_button->active
-                        = direction_a (self, direction, href,
-                                       text_formatted, 0);
-                      free (text_formatted);
-                    }
-                  else
-                    formatted_button->passive = text_formatted;
-                }
-              free (href);
-            }
           formatted_button->need_delimiter = 1;
         }
       /* for the next cases, button->type == BST_direction */
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 5e0f3e8350..28af86ad40 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -2806,11 +2806,8 @@ pass_document_to_converter_sv (const CONVERTER 
*converter,
 /* build a Perl button data from pure C button structure.
    This is a partial implementation.
    This function can only be called for default buttons for now, so we do
-   not need to handle other types of buttons.  We could handle possibly
-   more: BST_direction_info with
-     BIT_selected_direction_information_type and
-     BIT_href_direction_information_type.
-   Other need Perl info */
+   not need to handle other types of buttons, which are either not
+   interesting to handle, or need Perl info */
 static SV *
 html_build_button (const CONVERTER *converter, BUTTON_SPECIFICATION *button,
                    int *user_function_number)
diff --git a/tp/Texinfo/XS/main/create_buttons.c 
b/tp/Texinfo/XS/main/create_buttons.c
index fc6826e854..b1a8c1b3e9 100644
--- a/tp/Texinfo/XS/main/create_buttons.c
+++ b/tp/Texinfo/XS/main/create_buttons.c
@@ -70,8 +70,7 @@ new_button_specification (BUTTON_SPECIFICATION *button,
 
       if (info_type == BIT_function)
         button_spec->bi.button_function.type = function_type;
-      else if (info_type == BIT_selected_direction_information_type
-               || info_type == BIT_href_direction_information_type)
+      else if (info_type == BIT_selected_direction_information_type)
         button_spec->bi.direction_information_type = text_type;
     }
 }
diff --git a/tp/Texinfo/XS/main/customization_options.c 
b/tp/Texinfo/XS/main/customization_options.c
index 4a524a289c..00639b6a26 100644
--- a/tp/Texinfo/XS/main/customization_options.c
+++ b/tp/Texinfo/XS/main/customization_options.c
@@ -391,8 +391,7 @@ copy_option (OPTION *destination, const OPTION *source)
                           button_spec->bi.button_function.sv_reference
                             = s_button_spec->bi.button_function.sv_reference;
                         }
-                      else /* BIT_selected_direction_information_type
-                            and BIT_href_direction_information_type */
+                      else /* BIT_selected_direction_information_type */
                         button_spec->bi.direction_information_type
                           = s_button_spec->bi.direction_information_type;
                     }
diff --git a/tp/Texinfo/XS/main/get_perl_info.c 
b/tp/Texinfo/XS/main/get_perl_info.c
index 4b0846335b..0041e88486 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -796,12 +796,6 @@ html_get_button_specification_list (const CONVERTER 
*converter,
                       text_type_p = text_type_string +2;
                       text_type_p += strspn (text_type_p, whitespace_chars);
                     }
-                  else
-                    {
-                      text_type_p = text_type_string;
-                      button_spec->type
-                        = BIT_href_direction_information_type;
-                    }
                   button_spec->bi.direction_information_type = -1;
                   for (j = 0; j < HTT_section +1; j++)
                     {
diff --git a/tp/Texinfo/XS/main/option_types.h 
b/tp/Texinfo/XS/main/option_types.h
index 734eccd13d..bb14d28a48 100644
--- a/tp/Texinfo/XS/main/option_types.h
+++ b/tp/Texinfo/XS/main/option_types.h
@@ -81,7 +81,6 @@ enum button_specification_type {
 enum button_information_type {
    BIT_function,
    BIT_selected_direction_information_type,
-   BIT_href_direction_information_type,
 };
 
 /* enum value corresponding to a default button formatting function



reply via email to

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