bug-texinfo
[Top][All Lists]
Advanced

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

Re: [BUG] command line definitions not expanded


From: Gavin Smith
Subject: Re: [BUG] command line definitions not expanded
Date: Sun, 21 Feb 2016 09:45:04 +0000

On 21 February 2016 at 06:19, Norbert Preining <address@hidden> wrote:
> Hi Gavin, hi all
>
> (please keep Cc)
>
> I am sorry for all the bug reports, but here is the next one that
> surfaced when building the documentation for gcc.
>
> In short, it seems that definitions given on the command line
>         --command='@set foobar value'
> are not properly expanded in the aux files.
>
> Here a minimal not working example:
>
> The following code works without problems:
>         \input texinfo   @c -*-texinfo-*-
>         @set cmd1 HELLO
>
>         What ever
>         @address@hidden address@hidden
>         Here we go
>         @bye
>
> But when I remove the @set line and instead call
>         texi2pdf --command='@set cmd1 HELLO' mwe.texi
> I get the following error:
>
> /home/norbert/Debian/gcc-doc/mwe/mwe.aux:1: TeX capacity exceeded, sorry 
> [input
>  stack size=5000].
> @value ->@begingroup @makevalueexpandable
>                                           @valuexxx
> .....
> l.1 ..., used in @value, is not set.} doc-title}{}
>
>
> The reason is that the mwe.aux file contains:
>
> @xrdef{{[No value for ``cmd1''address@hidden {Variable `cmd1', used in 
> @value, is not set.} doc-title}{}

The problem is that @setfilename is missing from the file, and
texi2dvi looks for that line to add the extra line. @setfilename was
required before, so this isn't a regression (I hope).

Here's a patch. Please try it, and if it works fine, I'll commit it
and upload the new texi2dvi.

It might work fine just to always add the extra lines after the first,
depending on how people use this command: for example, --command
"\ngngnngng" would break for older versions of texinfo.tex (similarly
index commands could break, and possibly others as well). I can't
think of a likely use-case which would break, but it's more reliable
to do it this way.

Index: texi2dvi
===================================================================
--- texi2dvi    (revision 7006)
+++ texi2dvi    (working copy)
@@ -1312,7 +1312,14 @@ insert_commands ()
     verbose "Inserting extra commands: $textra"
     case $in_lang in
       latex)   textra_cmd=1i;;
-      texinfo) textra_cmd='/address@hidden/a';;
+      texinfo)
+        # If @setfilename is used in the first few lines of the file,
+        # add the extra lines after it, otherwise add after the first line.
+        if sed 10q "$in_input" | grep "address@hidden"; then
+          textra_cmd='/address@hidden/a'
+        else
+          textra_cmd=1a
+        fi ;;
       *)       error 1 "internal error, unknown language: $in_lang";;
     esac
     $SED "$textra_cmd\\



reply via email to

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