texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/texi2any.pl: use a special value if 'FORMAT_


From: Patrice Dumas
Subject: branch master updated: * tp/texi2any.pl: use a special value if 'FORMAT_MENU' is set on the command line that is replaced by the output format default when the output format is known if the output format default is not nomenu, or set to 'menu'.
Date: Tue, 23 Feb 2021 15:33:43 -0500

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 d4d71d4  * tp/texi2any.pl: use a special value if 'FORMAT_MENU' is set 
on the command line that is replaced by the output format default when the 
output format is known if the output format default is not nomenu, or set to 
'menu'.
d4d71d4 is described below

commit d4d71d4c31ba86af1f5ab02c22720d5b219ae8d4
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 23 21:33:33 2021 +0100

    * tp/texi2any.pl: use a special value if 'FORMAT_MENU' is set on
    the command line that is replaced by the output format default
    when the output format is known if the output format default is
    not nomenu, or set to 'menu'.
---
 ChangeLog      |  7 +++++++
 tp/texi2any.pl | 27 +++++++++++++++++++++++----
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e44af8..c334f26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-02-23  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/texi2any.pl: use a special value if 'FORMAT_MENU' is set on
+       the command line that is replaced by the output format default
+       when the output format is known if the output format default is
+       not nomenu, or set to 'menu'.
+
 2021-02-22  Patrice Dumas  <pertusus@free.fr>
 
        Remove unused code.
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 5871900..90e5b15 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -838,9 +838,10 @@ There is NO WARRANTY, to the extent permitted by law.\n"), 
"2020";
                      if (!$_[1]) {
                        set_from_cmdline('FORMAT_MENU', 'nomenu');
                      } else {
-                       # NOTE this may be different from what the 
-                       # converter would have set in the default case.
-                       set_from_cmdline('FORMAT_MENU', 'menu');
+                       # a special value that is modified below when the
+                       # output format is known, to be the default for that
+                       # format, or 'menu'
+                       set_from_cmdline('FORMAT_MENU', 
'set_format_menu_from_cmdline_header');
                      }
                      $format = 'plaintext' if (!$_[1] and $format eq 'info'); 
},
  'output|out|o=s' => sub {
@@ -1070,6 +1071,22 @@ if (defined($formats_table{$format}->{'module'})) {
 if (defined($formats_table{$format}->{'module'})) {
   $converter_class = $formats_table{$format}->{'module'};
   %converter_defaults = $converter_class->converter_defaults();
+
+  # set FORMAT_MENU to the output format default, if not nomenu
+  if (defined(get_conf('FORMAT_MENU'))
+      and get_conf('FORMAT_MENU') eq 'set_format_menu_from_cmdline_header') {
+    if (defined($converter_defaults{'FORMAT_MENU'})
+        and $converter_defaults{'FORMAT_MENU'} ne 'nomenu') {
+      set_from_cmdline('FORMAT_MENU', $converter_defaults{'FORMAT_MENU'});
+    } else {
+      set_from_cmdline('FORMAT_MENU', 'menu');
+    }
+  }
+} else {
+  if (defined(get_conf('FORMAT_MENU'))
+      and get_conf('FORMAT_MENU') eq 'set_format_menu_from_cmdline_header') {
+    set_from_cmdline('FORMAT_MENU', 'menu');
+  }
 }
 
 # using no warnings is wrong, but a way to avoid a spurious warning.
@@ -1088,7 +1105,9 @@ foreach my $parser_settable_option (
 
 # Copy some of the customization variables into the parser options.
 # The configuration options are upper-cased when considered as 
-# customization variables, and lower-cased when passed to the Parser
+# customization variables, and lower-cased when passed to the Parser.
+# The customization variables passed here can only be set in perl
+# customization files, using set_from_init_file().
 foreach my $parser_option (map {uc($_)} 
                   (keys 
(%Texinfo::Common::default_parser_state_configuration))) {
   $parser_options->{lc($parser_option)} = get_conf($parser_option)



reply via email to

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