bug-texinfo
[Top][All Lists]
Advanced

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

makeinfo -D doesn't work the same way as before


From: Guo Yixuan
Subject: makeinfo -D doesn't work the same way as before
Date: Tue, 4 Mar 2014 17:29:34 -0500

Hi,

In building several info files, I need to use "-D" option to define variables and assign values.

In version <= 4.13, it works, but with newer version of texinfo, it fails.

$ # this is a one-line test file
$ cat test.texi
@value{var1}
$ # older version (4.13)
$ makeinfo -v -D 'var1 foo' -o test.info test.texi
makeinfo (GNU texinfo) 4.13
Making info file `test.info' from `test.texi'.
$ cat test.info
This is test.info, produced by makeinfo version 4.13 from test.texi.

foo

$ # new version of makeinfo (5.2)
$ makeinfo -v -D 'var1 foo' -o test.info test.texi
test.texi:1: warning: undefined flag: var1
Output file test.info
test.texi: warning: document without nodes
$ cat test.info
This is test.info, produced by makeinfo version 5.2 from test.texi.

{No value for 'var1'}


Tag Table:

End Tag Table
$

This patch should restore the old behavior.

--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -924,7 +924,15 @@ There is NO WARRANTY, to the extent perm
                         document_warn($message);
                       }
                     },
- 'D=s' => sub {$parser_default_options->{'values'}->{$_[1]} = 1;},
+ 'D=s' => sub {
+    my $var = $_[1];
+    my @field = split /\s+/, $var;
+    if (@field == 1) {
+      $parser_default_options->{'values'}->{$var} = 1;
+    } else {
+      $parser_default_options->{'values'}->{$field[0]} = $field[1];
+    }
+ },
  'U=s' => sub {delete $parser_default_options->{'values'}->{$_[1]};},
  'init-file=s' => sub {
     locate_and_load_init_file($_[1], [ @conf_dirs, @program_init_dirs ]);


Best regards,

GUO Yixuan

reply via email to

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