texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/Converter.pm (%common_conver


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/Converter.pm (%common_converters_defaults) (output_tree), tp/Texinfo/Convert/HTML.pm (_external_node_href) (_setup_output), tp/Texinfo/Convert/IXIN.pm, tp/Texinfo/Convert/Info.pm (output), tp/Texinfo/Convert/LaTeX.pm (output), tp/Texinfo/Convert/Plaintext.pm (output), tp/Texinfo/XS/convert/converter.c (apply_converter_info) (destroy_converter_initialization_info) (copy_converter_initialization_info, free_generic_converter), tp/Texinfo/XS/convert/format_html.c (external [...]
Date: Sat, 05 Oct 2024 05:37:25 -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 3518a2eedc * tp/Texinfo/Convert/Converter.pm 
(%common_converters_defaults) (output_tree), tp/Texinfo/Convert/HTML.pm 
(_external_node_href) (_setup_output), tp/Texinfo/Convert/IXIN.pm, 
tp/Texinfo/Convert/Info.pm (output), tp/Texinfo/Convert/LaTeX.pm (output), 
tp/Texinfo/Convert/Plaintext.pm (output), tp/Texinfo/XS/convert/converter.c 
(apply_converter_info) (destroy_converter_initialization_info) 
(copy_converter_initialization_info, free_generic_converter), 
tp/Texinfo/XS/convert/fo [...]
3518a2eedc is described below

commit 3518a2eedc320027aafa425e950b4301ea277003
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Aug 30 13:48:46 2024 +0200

    * tp/Texinfo/Convert/Converter.pm (%common_converters_defaults)
    (output_tree), tp/Texinfo/Convert/HTML.pm (_external_node_href)
    (_setup_output), tp/Texinfo/Convert/IXIN.pm,
    tp/Texinfo/Convert/Info.pm (output), tp/Texinfo/Convert/LaTeX.pm
    (output), tp/Texinfo/Convert/Plaintext.pm (output),
    tp/Texinfo/XS/convert/converter.c (apply_converter_info)
    (destroy_converter_initialization_info)
    (copy_converter_initialization_info, free_generic_converter),
    tp/Texinfo/XS/convert/format_html.c (external_node_href),
    tp/Texinfo/XS/convert/get_converter_perl_info.c
    (get_converter_info_from_sv),
    tp/Texinfo/XS/convert/html_prepare_converter.c (html_setup_output),
    tp/Texinfo/XS/convert/texinfo.c (txi_converter_setup),
    tp/Texinfo/XS/main/build_perl_info.c
    (pass_generic_converter_to_converter_sv),
    tp/Texinfo/XS/main/converter_types.h (CONVERTER_INITIALIZATION_INFO)
    (CONVERTER), tp/t/test_converter_option.t, tp/t/test_utils.pl
    (set_converter_option_defaults), tp/texi2any.pl: use
    TEXINFO_OUTPUT_FORMAT customization variable value instead of
    self->{'output_format'}.  Remove self->{'output_format'} and similar C
    data.
    
    * doc/texinfo.texi (Customization Variables and Options)
    (Customization Variables, Global Customization Variables): document
    TEXINFO_OUTPUT_FORMAT in global customization variables, and explain
    that TEXINFO_OUTPUT_FORMAT is alwyas set.
---
 ChangeLog                                       | 29 +++++++++++++++++++++++++
 doc/texinfo.texi                                | 22 +++++++++++++++++--
 tp/Texinfo/Convert/Converter.pm                 |  4 ++--
 tp/Texinfo/Convert/HTML.pm                      |  9 ++++----
 tp/Texinfo/Convert/IXIN.pm                      |  3 ++-
 tp/Texinfo/Convert/Info.pm                      |  3 ++-
 tp/Texinfo/Convert/LaTeX.pm                     |  3 ++-
 tp/Texinfo/Convert/Plaintext.pm                 |  3 ++-
 tp/Texinfo/XS/convert/converter.c               | 17 +--------------
 tp/Texinfo/XS/convert/format_html.c             |  6 +++--
 tp/Texinfo/XS/convert/get_converter_perl_info.c | 28 +++++++++---------------
 tp/Texinfo/XS/convert/html_prepare_converter.c  |  3 ++-
 tp/Texinfo/XS/convert/texinfo.c                 | 14 +++++++-----
 tp/Texinfo/XS/main/build_perl_info.c            |  3 ---
 tp/Texinfo/XS/main/converter_types.h            |  2 --
 tp/Texinfo/XS/teximakehtml.c                    |  6 ++---
 tp/t/test_converter_option.t                    | 13 ++++++-----
 tp/t/test_utils.pl                              |  8 ++++---
 tp/texi2any.pl                                  |  1 -
 19 files changed, 104 insertions(+), 73 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1a47eb9c95..6bbfc697fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2024-08-30  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Converter.pm (%common_converters_defaults)
+       (output_tree), tp/Texinfo/Convert/HTML.pm (_external_node_href)
+       (_setup_output), tp/Texinfo/Convert/IXIN.pm,
+       tp/Texinfo/Convert/Info.pm (output), tp/Texinfo/Convert/LaTeX.pm
+       (output), tp/Texinfo/Convert/Plaintext.pm (output),
+       tp/Texinfo/XS/convert/converter.c (apply_converter_info)
+       (destroy_converter_initialization_info)
+       (copy_converter_initialization_info, free_generic_converter),
+       tp/Texinfo/XS/convert/format_html.c (external_node_href),
+       tp/Texinfo/XS/convert/get_converter_perl_info.c
+       (get_converter_info_from_sv),
+       tp/Texinfo/XS/convert/html_prepare_converter.c (html_setup_output),
+       tp/Texinfo/XS/convert/texinfo.c (txi_converter_setup),
+       tp/Texinfo/XS/main/build_perl_info.c
+       (pass_generic_converter_to_converter_sv),
+       tp/Texinfo/XS/main/converter_types.h (CONVERTER_INITIALIZATION_INFO)
+       (CONVERTER), tp/t/test_converter_option.t, tp/t/test_utils.pl
+       (set_converter_option_defaults), tp/texi2any.pl: use
+       TEXINFO_OUTPUT_FORMAT customization variable value instead of
+       self->{'output_format'}.  Remove self->{'output_format'} and similar C
+       data.
+
+       * doc/texinfo.texi (Customization Variables and Options)
+       (Customization Variables, Global Customization Variables): document
+       TEXINFO_OUTPUT_FORMAT in global customization variables, and explain
+       that TEXINFO_OUTPUT_FORMAT is alwyas set.
+
 2024-08-30  Patrice Dumas  <pertusus@free.fr>
 
        * tp/texi2any.pl ($output_format): rename $format as $output_format.
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index b9c45aceb0..eedab1387c 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -15336,7 +15336,8 @@ Those associated with @@-commands; for example,
 @item
 Those associated with command-line options; for example, the
 customization variable @code{SPLIT} is associated with the
-@option{--split} command-line option, and @code{TEXINFO_OUTPUT_FORMAT}
+@option{--split} command-line option. @code{TEXINFO_OUTPUT_FORMAT}
+is set based on output format command line options and
 allows specifying the output format.
 
 @item
@@ -15513,7 +15514,10 @@ forms:
 @itemx xml
 These correspond to the command-line options (and
 @code{TEXINFO_OUTPUT_FORMAT} environment variable values) of the same
-name.  @xref{Invoking @command{texi2any}}.
+name.  The @code{TEXINFO_OUTPUT_FORMAT} customization variable value
+is set when command-line options (or @code{TEXINFO_OUTPUT_FORMAT}
+environment variable values) set the output format.
+@xref{Invoking @command{texi2any}}.
 
 @cindex tree representation, for debugging
 @cindex debugging document, with tree representation
@@ -15775,6 +15779,20 @@ generated anew for each run (date, program name, 
version) are set to
 fixed and given values.  This is useful to compare the output to a
 reference file, as is done for the tests.  The default is false.
 
+@item TEXINFO_OUTPUT_FORMAT
+The generated output format.  Set from command line with options such as
+@option{--html}, as the @env{TEXINFO_OUTPUT_FORMAT} environment variable
+value (@pxref{@command{texi2any} Environment Variables}) or as a customization
+option.  @xref{Customization Variables and Options}
+
+The value set in the @code{TEXINFO_OUTPUT_FORMAT} variable is in general the
+same as the name used to set the format, but not always.  If the format is set
+to @code{xml}, with @option{--xml}, with the @env{TEXINFO_OUTPUT_FORMAT}
+environment variable or with a customization variable the
+@code{TEXINFO_OUTPUT_FORMAT} customization variable is set to a more
+specific output format name @code{texinfoxml}.  That kind of difference
+in naming should not have any user-visible consequence.
+
 @item TREE_TRANSFORMATIONS
 The associated value is a comma separated list of transformations that
 can be applied to the Texinfo tree prior to outputting the result.  If
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index eb29c61480..a5e11efdfc 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -144,7 +144,6 @@ my $common_defaults = 
Texinfo::Options::get_converter_regular_options('common');
 # It would be good to keep it that way.
 my %common_converters_defaults = (
   # Following are set in the main program
-  'output_format'        => undef,
   'deprecated_config_directories' => undef,
 
   # Not set in the main program
@@ -371,7 +370,8 @@ sub output_tree($$)
   my $root = $document->tree();
 
   my ($output_file, $destination_directory, $output_filename)
-    = $self->determine_files_and_directory($self->{'output_format'});
+    = $self->determine_files_and_directory(
+                              $self->get_conf('TEXINFO_OUTPUT_FORMAT'));
 
   my ($encoded_destination_directory, $dir_encoding)
     = $self->encoded_output_file_name($destination_directory);
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index a105e7c9ae..547df90efa 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -10732,9 +10732,9 @@ sub _external_node_href($$$)
         } elsif ($self->get_conf('SPLIT')) {
           $directory = "../$manual_base";
         }
-        if (defined($self->{'output_format'})
-            and $self->{'output_format'} ne '') {
-          $directory .= '_'.$self->{'output_format'};
+        my $output_format = $self->get_conf('TEXINFO_OUTPUT_FORMAT');
+        if (defined($output_format) and $output_format ne '') {
+          $directory .= '_'.$output_format;
         }
         $directory = $self->url_protect_file_text($directory);
       }
@@ -13115,7 +13115,8 @@ sub _setup_output($)
   # particular when output_file is '', 'destination_directory' that
   # is mainly useful when split and 'document_name' that is generally useful.
   my ($output_file, $destination_directory, $output_filename, $document_name)
-        = $self->determine_files_and_directory($self->{'output_format'});
+        = $self->determine_files_and_directory(
+                              $self->get_conf('TEXINFO_OUTPUT_FORMAT'));
 
   # set for init files
   $self->{'converter_info'}->{'document_name'} = $document_name;
diff --git a/tp/Texinfo/Convert/IXIN.pm b/tp/Texinfo/Convert/IXIN.pm
index 62d8d2da96..e06c2fd02d 100644
--- a/tp/Texinfo/Convert/IXIN.pm
+++ b/tp/Texinfo/Convert/IXIN.pm
@@ -326,7 +326,8 @@ sub output_ixin($$)
   $self->conversion_initialization($document);
 
   my ($output_file, $destination_directory, $output_filename)
-    = $self->determine_files_and_directory($self->{'output_format'});
+    = $self->determine_files_and_directory(
+                                  $self->get_conf('TEXINFO_OUTPUT_FORMAT'));
 
   my ($encoded_destination_directory, $dir_encoding)
     = $self->encoded_output_file_name($destination_directory);
diff --git a/tp/Texinfo/Convert/Info.pm b/tp/Texinfo/Convert/Info.pm
index 9e333df44c..e5b5ce2653 100644
--- a/tp/Texinfo/Convert/Info.pm
+++ b/tp/Texinfo/Convert/Info.pm
@@ -76,7 +76,8 @@ sub output($$)
 
   my ($output_file, $destination_directory, $output_filename,
       $document_name, $input_basefile)
-        = $self->determine_files_and_directory($self->{'output_format'});
+        = $self->determine_files_and_directory(
+                               $self->get_conf('TEXINFO_OUTPUT_FORMAT'));
   my ($encoded_destination_directory, $dir_encoding)
     = $self->encoded_output_file_name($destination_directory);
   my ($succeeded, $created_directory)
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 528b744839..354597b92c 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -1073,7 +1073,8 @@ sub output($$)
   my $root = $document->tree();
 
   my ($output_file, $destination_directory, $output_filename)
-    = $self->determine_files_and_directory($self->{'output_format'});
+    = $self->determine_files_and_directory(
+                                  $self->get_conf('TEXINFO_OUTPUT_FORMAT'));
 
   my ($encoded_destination_directory, $dir_encoding)
     = $self->encoded_output_file_name($destination_directory);
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 2a99b8724b..ab432ffa50 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -678,7 +678,8 @@ sub output($$)
 
   my ($output_file, $destination_directory, $output_filename,
        $document_name)
-      = $self->determine_files_and_directory($self->{'output_format'});
+      = $self->determine_files_and_directory(
+                          $self->get_conf('TEXINFO_OUTPUT_FORMAT'));
   my ($encoded_destination_directory, $dir_encoding)
     = $self->encoded_output_file_name($destination_directory);
   my $succeeded
diff --git a/tp/Texinfo/XS/convert/converter.c 
b/tp/Texinfo/XS/convert/converter.c
index d0bba8785b..3fb9780e35 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -324,12 +324,6 @@ apply_converter_info (CONVERTER *converter,
                              converter->sorted_options,
                              &init_info->conf, set_configured);
 
-  if (init_info->output_format)
-    {
-      free (converter->output_format);
-      converter->output_format = strdup (init_info->output_format);
-    }
-
   if (init_info->translated_commands)
     {
       destroy_translated_commands (converter->translated_commands);
@@ -375,7 +369,7 @@ set_converter_init_information (CONVERTER *converter,
   /*
   fprintf (stderr, "XS|CONVERTER Fill conf: %d; %s, %s\n",
                    converter->converter_descriptor,
-                   converter->output_format);
+                   converter->conf->TEXINFO_OUTPUT_FORMAT.o.string);
    */
 }
 
@@ -394,8 +388,6 @@ destroy_converter_initialization_info 
(CONVERTER_INITIALIZATION_INFO *init_info)
   if (init_info->translated_commands)
     destroy_translated_commands (init_info->translated_commands);
 
-  free (init_info->output_format);
-
   free_options_list (&init_info->conf);
 
   free_strings_list (&init_info->non_valid_customization);
@@ -406,12 +398,6 @@ static void
 copy_converter_initialization_info (CONVERTER_INITIALIZATION_INFO *dst_info,
                                const CONVERTER_INITIALIZATION_INFO *src_info)
 {
-  if (src_info->output_format)
-    {
-      free (dst_info->output_format);
-      dst_info->output_format = strdup (src_info->output_format);
-    }
-
   copy_strings (&dst_info->non_valid_customization,
                 &src_info->non_valid_customization);
 
@@ -1750,7 +1736,6 @@ free_generic_converter (CONVERTER *self)
       destroy_translated_commands (self->translated_commands);
     }
 
-  free (self->output_format);
   free (self->expanded_formats);
 
   if (self->init_conf)
diff --git a/tp/Texinfo/XS/convert/format_html.c 
b/tp/Texinfo/XS/convert/format_html.c
index 997f9bab65..a3d676e39d 100644
--- a/tp/Texinfo/XS/convert/format_html.c
+++ b/tp/Texinfo/XS/convert/format_html.c
@@ -847,6 +847,8 @@ external_node_href (CONVERTER *self, const ELEMENT 
*external_node,
               TEXT dir_path;
               char *url_encoded_path;
               text_init (&dir_path);
+              const char *output_format
+                = self->conf->TEXINFO_OUTPUT_FORMAT.o.string;
 
               if (self->conf->EXTERNAL_DIR.o.string)
                 {
@@ -859,10 +861,10 @@ external_node_href (CONVERTER *self, const ELEMENT 
*external_node,
                   text_append_n (&dir_path, "../", 3);
                   text_append (&dir_path, manual_base);
                 }
-              if (self->output_format && strlen (self->output_format))
+              if (output_format && strlen (output_format))
                 {
                   text_append_n (&dir_path, "_", 1);
-                  text_append (&dir_path, self->output_format);
+                  text_append (&dir_path, output_format);
                 }
               url_encoded_path = url_protect_file_text (self, dir_path.text);
               free (dir_path.text);
diff --git a/tp/Texinfo/XS/convert/get_converter_perl_info.c 
b/tp/Texinfo/XS/convert/get_converter_perl_info.c
index 4039838013..364bcb2af2 100644
--- a/tp/Texinfo/XS/convert/get_converter_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_converter_perl_info.c
@@ -281,28 +281,20 @@ get_converter_info_from_sv (SV *conf_sv, const char 
*class_name,
             {
               if (status == -2)
                 {
-                  /* next two passed in
-                     pass_generic_converter_to_converter_sv */
-                  if (!strcmp (key, "output_format"))
-                    initialization_info->output_format
-                      = non_perl_strdup (SvPVutf8_nolen (value));
+                  add_string (key,
+                    &initialization_info->non_valid_customization);
+
+                  if (!strcmp (key, "translated_commands"))
+                    initialization_info->translated_commands
+                      = set_translated_commands (value);
                   /* FIXME get deprecated_config_directories if needed */
                   else if (!strcmp (key, "deprecated_config_directories"))
                     {}
-                  else
+                  else if (class_name)
                     {
-                      add_string (key,
-                        &initialization_info->non_valid_customization);
-
-                      if (!strcmp (key, "translated_commands"))
-                        initialization_info->translated_commands
-                          = set_translated_commands (value);
-                      else if (class_name)
-                        {
-                          fprintf (stderr,
-                                   "%s: %s not a possible configuration\n",
-                                   class_name, key);
-                        }
+                      fprintf (stderr,
+                               "%s: %s not a possible configuration\n",
+                               class_name, key);
                     }
                 }
               else
diff --git a/tp/Texinfo/XS/convert/html_prepare_converter.c 
b/tp/Texinfo/XS/convert/html_prepare_converter.c
index df80634730..d0504b8599 100644
--- a/tp/Texinfo/XS/convert/html_prepare_converter.c
+++ b/tp/Texinfo/XS/convert/html_prepare_converter.c
@@ -3500,7 +3500,8 @@ html_setup_output (CONVERTER *self, char **paths)
   html_prepare_css (self);
 
   /* ($output_file, $destination_directory, $output_filename, $document_name) 
*/
-  determine_files_and_directory (self, self->output_format, paths);
+  determine_files_and_directory (self,
+                          self->conf->TEXINFO_OUTPUT_FORMAT.o.string, paths);
 
   self->document_name = strdup (paths[3]);
   self->destination_directory = strdup (paths[1]);
diff --git a/tp/Texinfo/XS/convert/texinfo.c b/tp/Texinfo/XS/convert/texinfo.c
index ad5a032948..87d2c44277 100644
--- a/tp/Texinfo/XS/convert/texinfo.c
+++ b/tp/Texinfo/XS/convert/texinfo.c
@@ -298,13 +298,15 @@ txi_converter_setup (const char *format_str,
 
   conf = new_converter_initialization_info ();
 
+  initialize_options_list (&conf->conf, 10);
+
   /* prepare specific information for the converter */
   if (output_format)
-    conf->output_format = strdup (output_format);
+    add_option_string_value (&conf->conf, txi_base_sorted_options,
+                        "TEXINFO_OUTPUT_FORMAT", 0, output_format);
   else
-    conf->output_format = strdup (format_str);
-
-  initialize_options_list (&conf->conf, 10);
+    add_option_string_value (&conf->conf, txi_base_sorted_options,
+                        "TEXINFO_OUTPUT_FORMAT", 0, format_str);
 
   if (texinfo_language_config_dirs)
     {
@@ -316,14 +318,14 @@ txi_converter_setup (const char *format_str,
   /* similar to options coming from texi2any */
   add_option_string_value (&conf->conf, txi_base_sorted_options,
    /*
-                           "PROGRAM", 0, program_file);
     */
+                           "PROGRAM", 0, program_file);
   /* comment the line above and uncomment below to compare with
      texi2any output
-   */
                            "PROGRAM", 0, "texi2any");
   add_option_string_value (&conf->conf, txi_base_sorted_options,
                       "PACKAGE_AND_VERSION", 0, "Texinfo 7.1.90+dev");
+   */
   add_option_string_value (&conf->conf, txi_base_sorted_options,
                         "COMMAND_LINE_ENCODING", 0, locale_encoding);
   add_option_string_value (&conf->conf, txi_base_sorted_options,
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index b0a9beacec..8364dedca7 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -3154,9 +3154,6 @@ pass_generic_converter_to_converter_sv (SV *converter_sv,
     = build_translated_commands (converter->translated_commands);
   STORE("translated_commands", newRV_noinc ((SV *) translated_commands_hv));
 
-  if (converter->output_format)
-    STORE("output_format", newSVpv_utf8 (converter->output_format, 0));
-
   /* store converter_descriptor in perl converter */
   /* NOTE unlikely IV overflow if PERL_QUAD_MAX < SIZE_MAX */
   STORE("converter_descriptor", newSViv ((IV)converter->converter_descriptor));
diff --git a/tp/Texinfo/XS/main/converter_types.h 
b/tp/Texinfo/XS/main/converter_types.h
index f0bd03ea82..16a14328ee 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -763,7 +763,6 @@ typedef struct PRE_CLASS_TYPE_INFO {
 /* information on converter configuration from a source of configuration
    (either output format or user customization) */
 typedef struct CONVERTER_INITIALIZATION_INFO {
-    char *output_format;
     TRANSLATED_COMMAND *translated_commands;
     OPTIONS_LIST conf;
     /* gather strings that are not customization options */
@@ -788,7 +787,6 @@ typedef struct CONVERTER {
     OPTION **sorted_options;
     OPTIONS *init_conf;
     OPTIONS *format_defaults_conf;
-    char *output_format;
     EXPANDED_FORMAT *expanded_formats;
     TRANSLATED_COMMAND *translated_commands;
 
diff --git a/tp/Texinfo/XS/teximakehtml.c b/tp/Texinfo/XS/teximakehtml.c
index 6688904a7e..aacf5a1a12 100644
--- a/tp/Texinfo/XS/teximakehtml.c
+++ b/tp/Texinfo/XS/teximakehtml.c
@@ -215,19 +215,19 @@ main (int argc, char *argv[])
   /* customize buttons.  It is a bit silly to use link buttons for
      footer, it is for the demonstration */
   custom_node_footer_buttons = new_base_links_buttons (0);
-  /*
   add_new_button_option (&convert_options,
                      "NODE_FOOTER_BUTTONS", custom_node_footer_buttons);
   add_new_option_value (&convert_options, GOT_integer,
                            "PROGRAM_NAME_IN_FOOTER", 1, 0);
+  /*
    */
   /* this is set to help with comparison with previous invokations */
-  /*
   add_new_option_value (&convert_options, GOT_integer,
                            "TEST", 1, 0);
-   */
+  /*
   add_new_option_value (&convert_options, GOT_integer,
                         "CHECK_HTMLXREF", 1, 0);
+   */
 
   memset (&converter_texinfo_language_config_dirs, 0, sizeof (STRING_LIST));
 
diff --git a/tp/t/test_converter_option.t b/tp/t/test_converter_option.t
index 3cfb16a28e..c000c70134 100644
--- a/tp/t/test_converter_option.t
+++ b/tp/t/test_converter_option.t
@@ -16,14 +16,14 @@ use Texinfo::Convert::DocBook;
 my $html_converter = Texinfo::Convert::HTML->converter({'toto' => 1});
 # cannot be used to test, as it triggers a call to confess
 #my $toto = $html_converter->get_conf('toto');
-my $html_output_format = $html_converter->{'output_format'};
+my $html_output_format = $html_converter->get_conf('TEXINFO_OUTPUT_FORMAT');
 #print STDERR "HTML: o '$html_output_format'\n";
 is ($html_output_format, undef, 'HTML output_format unset');
 
 my $html_converter_with_output_format
-  = Texinfo::Convert::HTML->converter({'output_format' => 'my format'});
+  = Texinfo::Convert::HTML->converter({'TEXINFO_OUTPUT_FORMAT' => 'my 
format'});
 my $html_output_format_with_output_format
-  = $html_converter_with_output_format->{'output_format'};
+  = $html_converter_with_output_format->get_conf('TEXINFO_OUTPUT_FORMAT');
 #print STDERR "HTML: s o '$html_output_format_with_output_format'\n";
 is ($html_output_format_with_output_format, 'my format',
                                             'HTML output_format set');
@@ -31,14 +31,15 @@ is ($html_output_format_with_output_format, 'my format',
 my $info_converter = Texinfo::Convert::Info->converter({'titi' => 1});
 
 my $docbook_converter = Texinfo::Convert::DocBook->converter();
-my $docbook_output_format = $docbook_converter->{'output_format'};
+my $docbook_output_format
+  = $docbook_converter->get_conf('TEXINFO_OUTPUT_FORMAT');
 #print STDERR "DocBook: o '$docbook_output_format'\n";
 is ($docbook_output_format, undef, 'DocBook output_format unset');
 
 my $docbook_converter_with_output_format
-  = Texinfo::Convert::DocBook->converter({'output_format' => 'my dbk'});
+  = Texinfo::Convert::DocBook->converter({'TEXINFO_OUTPUT_FORMAT' => 'my 
dbk'});
 my $docbook_output_format_with_output_format
-  = $docbook_converter_with_output_format->{'output_format'};
+  = $docbook_converter_with_output_format->get_conf('TEXINFO_OUTPUT_FORMAT');
 #print STDERR "DocBook: s o '$docbook_output_format_with_output_format'\n";
 is ($docbook_output_format_with_output_format, 'my dbk',
                                                'DocBook output_format set');
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 12da2cb13b..7acf989d23 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -415,9 +415,11 @@ sub set_converter_option_defaults($$;$)
   if (!defined($converter_options->{'EXPANDED_FORMATS'})) {
     $converter_options->{'EXPANDED_FORMATS'} = [$format];
   }
-  if (!defined($converter_options->{'output_format'})) {
-    $converter_options->{'output_format'} = $format;
-  }
+
+  # NOTE not the same as in texi2any if the format and the output
+  # format name do not match, the case of xml, which output format
+  # name is texinfoxml.
+  $converter_options->{'TEXINFO_OUTPUT_FORMAT'} = $format;
 
   if (!defined($converter_options->{'DEBUG'})) {
     $converter_options->{'DEBUG'} = $debug;
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 174098e822..0474ae8363 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1972,7 +1972,6 @@ while(@input_files) {
   # It could be possible to pass some information if it allows
   # for instance to have some consistent information for Structuring
   # and Converters.
-  $converter_options->{'output_format'} = $output_format;
   $converter_options->{'deprecated_config_directories'}
      = \%deprecated_directories;
   unshift @{$converter_options->{'INCLUDE_DIRECTORIES'}},



reply via email to

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