bug-texinfo
[Top][All Lists]
Advanced

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

Re: Defining variable on command line


From: Gavin Smith
Subject: Re: Defining variable on command line
Date: Fri, 28 Dec 2018 16:53:35 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Dec 15, 2018 at 02:02:22PM -0500, olivier wrote:
> Hi,
> 
> The *-D VAR* option doesn't seem to work when not compiling to
> plaintext.  i.e. that the variable is not set when compiling to pdf
> for example.  I manage to get around the problem by using *texi2pdf**
> **--command="@set VAR" *instead of using *texi2any -D VAR*.  I would
> love to help you patch this, but I have 0 knowledge in Perl.

I don't see any reason why this shouldn't be implemented.  This ought to work:

diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 47a37fa..2e96652 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -2,8 +2,7 @@
 
 # texi2any: Texinfo converter.
 #
-# Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 
-# Free Software Foundation, Inc.
+# Copyright 2010-2018 Free Software Foundation, Inc.
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1369,6 +1368,12 @@ foreach my $unclosed_file (keys(%unclosed_files)) {
 }
 
 if ($call_texi2dvi) {
+  if (%{$parser_default_options->{'values'}}) {
+    for my $flag (keys %{$parser_default_options->{'values'}}) {
+      my $value = $parser_default_options->{'values'}->{$flag};
+      push @texi2dvi_args, "address@hidden $flag $value";
+    }
+  }
   if (get_conf('DEBUG') or get_conf('VERBOSE')) {
     print STDERR "EXEC ".join('|', (get_conf('TEXI2DVI'), @texi2dvi_args, 
@ARGV)) 
        ."\n";


Could you patch your version of texi2any and test this?

> Also, I'm sure you already know that one, but Perl is crying on every
> invocation of texi2any,
> saying that one of your regex is deprecated and will be fatal in Perl 5.32.

Yes, we know.



reply via email to

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