bug-texinfo
[Top][All Lists]
Advanced

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

Re: @macro expansion bug


From: Eli Zaretskii
Subject: Re: @macro expansion bug
Date: Mon, 26 Mar 2001 09:48:12 +0200 (IST)

On Sun, 25 Mar 2001, Werner LEMBERG wrote:

> > In general, @def... directives are highly irregular in their use of
> > the braces and the magic conversions they perform on their
> > arguments.  Since these conversions are all specially written for
> > this family of commands, some of the aspects of their behavior are
> > next to impossible to grasp without experimenting, especially if you
> > use special characters such as `[' and `{'.
> 
> The brace problem you mean is this?
> 
>   @deffn {foo bar} name arguments...

Yes.  This use of braces is not allowed anywhere else in Texinfo; the 
function which normally reads input barfs when it sees `{'.  To make this 
work, the code which processes @deffn gobbles all the line and processes 
it with special code.

The usual way to expand macros in Texinfo constructs is to run the entire 
line via macro-expanding code _before_ you process the rest of the @deffn 
line, because a macro could expand into characters which are special to 
@deffn, such as the braces themselves.

However, macro expansion works by recursive invocation of the normal input 
read code, and that code chokes on unescaped braces...

> What about creating a variant of @deffn, say, @definition, which
> 
>   . is a regular texinfo function
>   . follows the standard syntactical rules
>   . works with macros
>   . doesn't format its arguments?
> 
> People than have to say e.g.
> 
>   @definition @w{cate gory} name @var{arg1} address@hidden ...

It's okay with me.  I'm not a TeXpert, but IIRC, the main problems with 
@def... directives is in that they have a variable argument list, and 
that is hard to support in texinfo.tex.  Karl, am I right?

> BTW, which are the messy parts of macros (besides the @deffn
> irregularities)?

I meant those irregularities.  Everything else is solvable, as we do in 
other directives where macros are fully supported.



reply via email to

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