bug-texinfo
[Top][All Lists]
Advanced

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

Re: Problem with texinfo.tex 6.0


From: Gavin Smith
Subject: Re: Problem with texinfo.tex 6.0
Date: Wed, 1 Jul 2015 18:53:51 +0100

On 1 July 2015 at 18:25, David Kastrup <address@hidden> wrote:
> Ugh.  So inside of the @warning argument, ",", "{", "}" need quoting
> with \ unless they are part of a macro argument themselves.

>From what I understand, when getting the brace-delimited argument to
@warning, braces in the argument shouldn't be quoted if they delimit
arguments to commands contained within the argument - with the current
texinfo.tex, this would lead literal brace glyphs to be output. TeX
gets the whole argument to @warning as long as the braces balance.
"\," wouldn't work either, because that is the cedilla command. It
seems to me that the only thing that it actually useful to quote with
a backslash in a macro argument, when processing with TeX, is another
backslash.

> At any rate, what you cite from the Texinfo manual converns macros with
> multiple arguments.  For the one-argument macro that is at bay here, we
> rather have
>
>   1. If a macro takes only one argument, all commas in its invocation
>      are quoted by default.  For example:
>
>           @macro TRYME{text}
>           @strong{TRYME: \text\}
>           @end macro
>
>           @TRYME{A nice feature, though it can be dangerous.}
>
>      will produce the following output
>
>           *TRYME: A nice feature, though it can be dangerous.*
>
>      And indeed, it can.  Namely, 'makeinfo' does not control the number
>      of arguments passed to one-argument macros, so be careful when you
>      invoke them.
>
> So it would appear that for the one-argument situation, some sort of
> quoting/protection/whatever of \ would seem warranted.

It would be possible to turn backslash interpretation off altogether
for single-parameter macros when invoked using braces (as is now done
for whole-line arguments), but this would be a bad idea because it
would be inconsistent with macros with more parameters, and likely
incompatible with makeinfo. (E.g. @warning{\\} should output a single
backslash, not two.)

It might be possible to do something using \ as an active character to
allow it to appear on its own to represent itself when not followed by
{, }, ,, or \. (I misspoke in my previous email: it's not an active
character while the argument is being read, it's an escape character,
with catcode 0.) I was working on something like this a few weeks ago.
I don't think it's essential though, just a nice feature that might be
tricky to implement properly.



reply via email to

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