bug-texinfo
[Top][All Lists]
Advanced

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

[PATCH] @value{} expanding to @xref{}


From: Sergey Poznyakoff
Subject: [PATCH] @value{} expanding to @xref{}
Date: Mon, 04 Oct 2004 15:04:33 +0300

Hello,

In GNU tar documentation we do not use @xref{} directly, instead we
define a value to be an appropriate xref command and then use @value
command throughout the document, e.g.:

<example>
  @set xref-absolute-names @xref{absolute}

  ...
  For example, you will probably
  not be able to store your home directory in an archive by invoking
  @command{tar} from the root directory; @value{xref-absolute-names}.
</example>

However, recent versions of makeinfo issue the following warning on
each line containing such usage:

tar.texi:1724: warning: `.' or `,' must follow @xref, not `}'.

(to reproduce, see the complete doc source at
http://sv.gnu.org/cgi-bin/viewcvs/tar/tar/doc/)

Obviously the context is correct, since a dot follows immediately
@value command. The diagnostics is displayed because reader_loop
at makeinfo.c:2230 increments input_text_offset after calling
pop_and_call_brace(), so that cm_xref(), when invoked, operates in
a wrong context.

To fix this I propose the following patch (against the CVS head):

Index: makeinfo/makeinfo.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.66
diff -p -u -r1.66 makeinfo.c
--- makeinfo/makeinfo.c 30 Aug 2004 22:11:39 -0000      1.66
+++ makeinfo/makeinfo.c 4 Oct 2004 11:59:40 -0000
@@ -3652,7 +3652,14 @@ cm_value (int arg, int start_pos, int en
          among other things.  */
 
       if (value)
-        execute_string ("%s", value);
+       {
+         /* We need to get past the closing brace since the value may
+            expand to a context-sensitive macro (e.g. @xref) and produce
+            spurious warnings */
+         input_text_offset++; 
+         execute_string ("%s", value);
+         input_text_offset--;
+       }
       else
        {
           warning (_("undefined flag: %s"), name);


Regards,
Sergey     




reply via email to

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