texinfo-devel
[Top][All Lists]
Advanced

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

Re: m4 lines handled everywhere?


From: Karl Berry
Subject: Re: m4 lines handled everywhere?
Date: Wed, 26 Oct 2011 21:52:09 GMT

    One question about #line directives.  Should they be ignored
    in some environments, like @example, @verbatim, @html, @ignore,
    ignored @if*?

I think the answer is no.  Trying to take account of context seems like
it will cause more problem than it solves.  The whole point is for
people to use m4 or whatever; m4 is not going to know when something is
in verbatim, and indeed, it is pretty plausible that those are exactly
the kind of places where m4 macros might be most useful.

Of course, it should only be recognized if it exactly matches the
necessary syntax.  See the Line Control node in cpp.texi.  Basically:
^\s*#\s*(line)? \d+ "[^"]+"(\s+\d+)*

E.g., running gcc -save-temps on hello world produces lines like this:
# 1 "/usr/include/bits/wordsize.h" 1 3 4
(The meaning of those trailing integers isn't documented that I can see.
I surmise it has something to do with include depth.  Anyway, all we
have to do is recognize and ignore them.)

This means that an existing manual which has a line in one of those
syntaxes would have to disable the #line processing.  I did a bunch of
searching on existing manuals, and found that only the cpp manual has
such a line.  (m4.texinfo doesn't.)

Alternatively, we could disable the #-processing by default.  That would
be safer, but, it seems to me, potentially less useful since it would
mean another step for anyone wanting to use m4.

Wdyt?



reply via email to

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