[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: different result with @macro and expansion
From: |
Karl Berry |
Subject: |
Re: different result with @macro and expansion |
Date: |
Wed, 30 Jan 2008 18:46:09 -0600 |
Getting back to this macro madness in your mail of 2 Oct 2007 09:22:59 +0200
(sorry for the ridiculous delay) --
@macro q{TEXT}
@html
\TEXT\
@end html
@end macro
Hi, my name is @q{Graham}.
But the expanded texinfo leads to an error:
Hi, my name is @html
Graham
@end html.
lilypond_macro_bug_expanded.texi:20: Bad argument `html.' to
address@hidden', using `html'.
I do not know any good way to fix this. Sometimes people want to write
macros that can be used inline (like this one is being used), other
times they want to write macros that need to end with a newline (like
this one is being defined). Can't do both at the same time.
The "Defining Macros" section of the texinfo manual says:
The newlines after the address@hidden' line and before the address@hidden
macro' line
are ignored, that is, not included in the macro body. [...]
So I think it's behaving as "intended", not that I'm a fan of the design
of @macro, as everyone here knows :).
As for why it works without the -E, I don't really know; I suppose
internally it must count the end of the macro as the end of an @end
command. Chalk it up to good luck. It's not claimed to work. (I wish
-E had never been implemented.)
You could add a blank line between the @end html and the @end macro;
then the @end html is on a line by itself in the -E output as it needs
to be. However, I worry that you'd end up with an unwanted space
between the "Graham" and the period. I don't know.
Unfortunately you can't move the @html outside of the @macro, the usual
workaround for these things, since then actual HTML in the body gets
translated, unfortunately. (< becomes <, etc.)
I'm not sure what else to say. Sorry.
karl
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: different result with @macro and expansion,
Karl Berry <=