texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Mon, 23 Dec 2024 17:56:19 -0500 (EST)

branch: master
commit cec91a283ff291417c5f165a574a4144010a4e92
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 8 11:51:22 2024 +0100

    * tp/maintain/regenerate_perl_options_info.pl,
    tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/HTML.pm: do not
    prepend converter_ in front of regular options defaults.  Rename
    get_converter_regular_options as get_regular_options.
    
    * tp/Texinfo/Convert/converters_defaults.txt,
    tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/HTML.pm,
    tp/Texinfo/XS/convert/html_converter_init_options.c
    (html_converter_defaults), tp/Texinfo/XS/convert/converter.c
    (set_generic_converter_options): update names.
---
 ChangeLog                                          | 13 ++++++
 tp/Texinfo/Convert/Converter.pm                    |  5 ++-
 tp/Texinfo/Convert/HTML.pm                         |  4 +-
 tp/Texinfo/Convert/converters_defaults.txt         | 11 ++---
 tp/Texinfo/Options.pm                              | 40 ++++++++---------
 tp/Texinfo/XS/convert/converter.c                  |  2 +-
 tp/Texinfo/XS/convert/converters_options.c         | 52 +++++++++++-----------
 tp/Texinfo/XS/convert/converters_options.h         | 16 +++----
 .../XS/convert/html_converter_init_options.c       |  2 +-
 tp/maintain/regenerate_perl_options_info.pl        |  4 +-
 10 files changed, 82 insertions(+), 67 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 94de9be65b..d169297186 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2024-12-08  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/maintain/regenerate_perl_options_info.pl,
+       tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/HTML.pm: do not
+       prepend converter_ in front of regular options defaults.  Rename
+       get_converter_regular_options as get_regular_options.
+
+       * tp/Texinfo/Convert/converters_defaults.txt,
+       tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/HTML.pm,
+       tp/Texinfo/XS/convert/html_converter_init_options.c
+       (html_converter_defaults), tp/Texinfo/XS/convert/converter.c
+       (set_generic_converter_options): update names.
+
 2024-12-08  Patrice Dumas  <pertusus@free.fr>
 
        * tp/maintain/regenerate_C_options_info.pl,
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 5e14a9e086..a57fc4fa36 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -125,13 +125,14 @@ sub import {
 # values for integer and string options in code generated from
 # Texinfo/Convert/converters_defaults.txt
 my $regular_defaults
-  = Texinfo::Options::get_converter_regular_options('converter');
+  = Texinfo::Options::get_regular_options('converter_defaults');
 
 my %defaults = %$regular_defaults;
 
 # values for integer and string options in code generated from
 # Texinfo/Convert/converters_defaults.txt
-my $common_defaults = 
Texinfo::Options::get_converter_regular_options('common');
+my $common_defaults
+  = Texinfo::Options::get_regular_options('converter_common');
 
 # defaults for all converters that are not defined elsewhere.
 # undef values in general marks information passed by the caller that
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 8969555fe0..1644e71b04 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -2521,7 +2521,7 @@ sub convert_tree_new_formatting_context($$$;$$$)
 
 # values for integer and string options in code generated from
 # Texinfo/Convert/converters_defaults.txt
-my $regular_defaults = Texinfo::Options::get_converter_regular_options('html');
+my $regular_defaults = Texinfo::Options::get_regular_options('html_converter');
 
 my %defaults = (
   # Customization option variables
@@ -13803,7 +13803,7 @@ sub _set_variables_texi2html($)
                              'Top', 'Contents', 'Index', 'About' ]],
   );
   my $regular_texi2html_options
-    = Texinfo::Options::get_converter_regular_options('texi2html');
+    = Texinfo::Options::get_regular_options('texi2html');
   foreach my $option (keys(%$regular_texi2html_options)) {
     $options->{$option} = $regular_texi2html_options->{$option};
   }
diff --git a/tp/Texinfo/Convert/converters_defaults.txt 
b/tp/Texinfo/Convert/converters_defaults.txt
index 672256ffa0..c2806879dd 100644
--- a/tp/Texinfo/Convert/converters_defaults.txt
+++ b/tp/Texinfo/Convert/converters_defaults.txt
@@ -1,5 +1,5 @@
 # Copyright 2010-2024 Free Software Foundation, Inc.
-# 
+#
 # This file is part of GNU Texinfo.
 #
 # GNU Texinfo is free software; you can redistribute it and/or modify
@@ -44,13 +44,14 @@ INPUT_FILE_NAME_ENCODING   undef
 # used for file name encoding
 LOCALE_ENCODING            undef
 
-# for Texinfo::Convert::Converter
-- converter
+# for Texinfo::Convert::Converter, used when a Converter does not redefine
+# the converter_defaults method
+- converter_defaults
 
 documentlanguage undef
 
 # in Texinfo::Convert::Converter, common to all the converters
-- common
+- converter_common
 
 # This is the default, mainly for tests; the caller should set them.  These
 # values are what is used in tests of the Converters.  These variables are
@@ -64,7 +65,7 @@ PACKAGE_URL           https://www.gnu.org/software/texinfo/
 PROGRAM               
 
 
-- html
+- html_converter
 
 BIG_RULE               <hr>
 BODY_ELEMENT_ATTRIBUTES  undef
diff --git a/tp/Texinfo/Options.pm b/tp/Texinfo/Options.pm
index d478b40d3f..7a000d98bb 100644
--- a/tp/Texinfo/Options.pm
+++ b/tp/Texinfo/Options.pm
@@ -268,18 +268,7 @@ our %unique_at_command_options = (
 
 my %regular_options_types;
 
-my %converter_common_regular_options_defaults = (
-  'PACKAGE'                          => 'texinfo',
-  'PACKAGE_NAME'                     => 'GNU Texinfo',
-  'PACKAGE_AND_VERSION'              => 'texinfo',
-  'PACKAGE_VERSION'                  => '',
-  'PACKAGE_URL'                      => 
'https://www.gnu.org/software/texinfo/',
-  'PROGRAM'                          => '',
-);
-
-$regular_options_types{'common'} = \%converter_common_regular_options_defaults;
-
-my %converter_common_parser_regular_options_defaults = (
+my %common_parser_regular_options_defaults = (
   'documentlanguage'                 => undef,
   'DEBUG'                            => 0,
   'FORMAT_MENU'                      => 'menu',
@@ -289,15 +278,26 @@ my %converter_common_parser_regular_options_defaults = (
   'LOCALE_ENCODING'                  => undef,
 );
 
-$regular_options_types{'common_parser'} = 
\%converter_common_parser_regular_options_defaults;
+$regular_options_types{'common_parser'} = 
\%common_parser_regular_options_defaults;
+
+my %converter_common_regular_options_defaults = (
+  'PACKAGE'                          => 'texinfo',
+  'PACKAGE_NAME'                     => 'GNU Texinfo',
+  'PACKAGE_AND_VERSION'              => 'texinfo',
+  'PACKAGE_VERSION'                  => '',
+  'PACKAGE_URL'                      => 
'https://www.gnu.org/software/texinfo/',
+  'PROGRAM'                          => '',
+);
+
+$regular_options_types{'converter_common'} = 
\%converter_common_regular_options_defaults;
 
-my %converter_converter_regular_options_defaults = (
+my %converter_defaults_regular_options_defaults = (
   'documentlanguage'                 => undef,
 );
 
-$regular_options_types{'converter'} = 
\%converter_converter_regular_options_defaults;
+$regular_options_types{'converter_defaults'} = 
\%converter_defaults_regular_options_defaults;
 
-my %converter_html_regular_options_defaults = (
+my %html_converter_regular_options_defaults = (
   'BIG_RULE'                         => '<hr>',
   'BODY_ELEMENT_ATTRIBUTES'          => undef,
   'CHAPTER_HEADER_LEVEL'             => 2,
@@ -353,9 +353,9 @@ my %converter_html_regular_options_defaults = (
   'xrefautomaticsectiontitle'        => 'on',
 );
 
-$regular_options_types{'html'} = \%converter_html_regular_options_defaults;
+$regular_options_types{'html_converter'} = 
\%html_converter_regular_options_defaults;
 
-my %converter_texi2html_regular_options_defaults = (
+my %texi2html_regular_options_defaults = (
   'FORMAT_MENU'                      => 'menu',
   'USE_SETFILENAME_EXTENSION'        => 0,
   'footnotestyle'                    => 'separate',
@@ -381,9 +381,9 @@ my %converter_texi2html_regular_options_defaults = (
   'FOOTNOTE_SEPARATE_HEADER_LEVEL'   => 1,
 );
 
-$regular_options_types{'texi2html'} = 
\%converter_texi2html_regular_options_defaults;
+$regular_options_types{'texi2html'} = \%texi2html_regular_options_defaults;
 
-sub get_converter_regular_options {
+sub get_regular_options {
   my $input = shift;
   return $regular_options_types{$input}
 }
diff --git a/tp/Texinfo/XS/convert/converter.c 
b/tp/Texinfo/XS/convert/converter.c
index d134874705..b044cdce6a 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -222,7 +222,7 @@ set_generic_converter_options (OPTIONS *options)
   set_converter_customization_options_defaults (options);
   set_unique_at_command_options_defaults (options);
   set_multiple_at_command_options_defaults (options);
-  set_common_regular_options_defaults (options);
+  set_converter_common_regular_options_defaults (options);
 }
 
 /* initialize the converter */
diff --git a/tp/Texinfo/XS/convert/converters_options.c 
b/tp/Texinfo/XS/convert/converters_options.c
index 1803054727..c86cb6e2ad 100644
--- a/tp/Texinfo/XS/convert/converters_options.c
+++ b/tp/Texinfo/XS/convert/converters_options.c
@@ -12,28 +12,6 @@
 /* external definition of html_fill_options_directions */
 #include "html_conversion_api.h"
 
-void
-set_common_regular_options_defaults (OPTIONS *options)
-{
-  option_set_conf (&options->PACKAGE, -2, "texinfo");
-  option_set_conf (&options->PACKAGE_NAME, -2, "GNU Texinfo");
-  option_set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
-  option_set_conf (&options->PACKAGE_VERSION, -2, "");
-  option_set_conf (&options->PACKAGE_URL, -2, 
"https://www.gnu.org/software/texinfo/";);
-  option_set_conf (&options->PROGRAM, -2, "");
-}
-
-void
-add_common_regular_options_defaults (OPTIONS_LIST *options_list)
-{
-  add_option_value (options_list, "PACKAGE", -2, "texinfo");
-  add_option_value (options_list, "PACKAGE_NAME", -2, "GNU Texinfo");
-  add_option_value (options_list, "PACKAGE_AND_VERSION", -2, "texinfo");
-  add_option_value (options_list, "PACKAGE_VERSION", -2, "");
-  add_option_value (options_list, "PACKAGE_URL", -2, 
"https://www.gnu.org/software/texinfo/";);
-  add_option_value (options_list, "PROGRAM", -2, "");
-}
-
 void
 set_common_parser_regular_options_defaults (OPTIONS *options)
 {
@@ -59,19 +37,41 @@ add_common_parser_regular_options_defaults (OPTIONS_LIST 
*options_list)
 }
 
 void
-set_converter_regular_options_defaults (OPTIONS *options)
+set_converter_common_regular_options_defaults (OPTIONS *options)
+{
+  option_set_conf (&options->PACKAGE, -2, "texinfo");
+  option_set_conf (&options->PACKAGE_NAME, -2, "GNU Texinfo");
+  option_set_conf (&options->PACKAGE_AND_VERSION, -2, "texinfo");
+  option_set_conf (&options->PACKAGE_VERSION, -2, "");
+  option_set_conf (&options->PACKAGE_URL, -2, 
"https://www.gnu.org/software/texinfo/";);
+  option_set_conf (&options->PROGRAM, -2, "");
+}
+
+void
+add_converter_common_regular_options_defaults (OPTIONS_LIST *options_list)
+{
+  add_option_value (options_list, "PACKAGE", -2, "texinfo");
+  add_option_value (options_list, "PACKAGE_NAME", -2, "GNU Texinfo");
+  add_option_value (options_list, "PACKAGE_AND_VERSION", -2, "texinfo");
+  add_option_value (options_list, "PACKAGE_VERSION", -2, "");
+  add_option_value (options_list, "PACKAGE_URL", -2, 
"https://www.gnu.org/software/texinfo/";);
+  add_option_value (options_list, "PROGRAM", -2, "");
+}
+
+void
+set_converter_defaults_regular_options_defaults (OPTIONS *options)
 {
   option_set_conf (&options->documentlanguage, -2, 0);
 }
 
 void
-add_converter_regular_options_defaults (OPTIONS_LIST *options_list)
+add_converter_defaults_regular_options_defaults (OPTIONS_LIST *options_list)
 {
   add_option_value (options_list, "documentlanguage", -2, 0);
 }
 
 void
-set_html_regular_options_defaults (OPTIONS *options)
+set_html_converter_regular_options_defaults (OPTIONS *options)
 {
   option_set_conf (&options->BIG_RULE, -2, "<hr>");
   option_set_conf (&options->BODY_ELEMENT_ATTRIBUTES, -2, 0);
@@ -129,7 +129,7 @@ set_html_regular_options_defaults (OPTIONS *options)
 }
 
 void
-add_html_regular_options_defaults (OPTIONS_LIST *options_list)
+add_html_converter_regular_options_defaults (OPTIONS_LIST *options_list)
 {
   add_option_value (options_list, "BIG_RULE", -2, "<hr>");
   add_option_value (options_list, "BODY_ELEMENT_ATTRIBUTES", -2, 0);
diff --git a/tp/Texinfo/XS/convert/converters_options.h 
b/tp/Texinfo/XS/convert/converters_options.h
index 40ab470dbc..a4de892b04 100644
--- a/tp/Texinfo/XS/convert/converters_options.h
+++ b/tp/Texinfo/XS/convert/converters_options.h
@@ -15,21 +15,21 @@
 #undef PACKAGE_URL
 #undef PACKAGE_VERSION
 
-void set_common_regular_options_defaults (OPTIONS *options);
-
-void add_common_regular_options_defaults (OPTIONS_LIST *options_list);
-
 void set_common_parser_regular_options_defaults (OPTIONS *options);
 
 void add_common_parser_regular_options_defaults (OPTIONS_LIST *options_list);
 
-void set_converter_regular_options_defaults (OPTIONS *options);
+void set_converter_common_regular_options_defaults (OPTIONS *options);
+
+void add_converter_common_regular_options_defaults (OPTIONS_LIST 
*options_list);
+
+void set_converter_defaults_regular_options_defaults (OPTIONS *options);
 
-void add_converter_regular_options_defaults (OPTIONS_LIST *options_list);
+void add_converter_defaults_regular_options_defaults (OPTIONS_LIST 
*options_list);
 
-void set_html_regular_options_defaults (OPTIONS *options);
+void set_html_converter_regular_options_defaults (OPTIONS *options);
 
-void add_html_regular_options_defaults (OPTIONS_LIST *options_list);
+void add_html_converter_regular_options_defaults (OPTIONS_LIST *options_list);
 
 void set_texi2html_regular_options_defaults (OPTIONS *options);
 
diff --git a/tp/Texinfo/XS/convert/html_converter_init_options.c 
b/tp/Texinfo/XS/convert/html_converter_init_options.c
index 97d2dd7011..376e40c45b 100644
--- a/tp/Texinfo/XS/convert/html_converter_init_options.c
+++ b/tp/Texinfo/XS/convert/html_converter_init_options.c
@@ -190,7 +190,7 @@ html_converter_defaults (enum converter_format format,
   CONVERTER_INITIALIZATION_INFO *format_defaults
     = new_converter_initialization_info ();
 
-  add_html_regular_options_defaults (&format_defaults->conf);
+  add_html_converter_regular_options_defaults (&format_defaults->conf);
 
   add_html_default_buttons_specifications (&format_defaults->conf, 0);
 
diff --git a/tp/maintain/regenerate_perl_options_info.pl 
b/tp/maintain/regenerate_perl_options_info.pl
index 9b5c4910bf..5622e34ae0 100755
--- a/tp/maintain/regenerate_perl_options_info.pl
+++ b/tp/maintain/regenerate_perl_options_info.pl
@@ -123,7 +123,7 @@ print OUT "my %regular_options_types;\n\n";
 my @sorted_formats = sort(keys(%converter_defaults));
 
 foreach my $format (@sorted_formats) {
-  my $hash = "%converter_${format}_regular_options_defaults";
+  my $hash = "%${format}_regular_options_defaults";
   print OUT "my $hash = (\n";
   foreach my $option_spec (@{$converter_defaults{$format}}) {
     my ($option, $value) = @$option_spec;
@@ -134,7 +134,7 @@ foreach my $format (@sorted_formats) {
   print OUT "\$regular_options_types{'$format'} = \\$hash;\n\n";
 }
 
-print OUT "sub get_converter_regular_options {\n";
+print OUT "sub get_regular_options {\n";
 print OUT "  my \$input = shift;\n";
 print OUT "  return \$regular_options_types{\$input}\n";
 print OUT "}\n\n";



reply via email to

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