emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [ox-publish] handling of white space in arguments of macros, nam


From: Nicolas Goaziou
Subject: Re: [O] [ox-publish] handling of white space in arguments of macros, named arguments?
Date: Thu, 28 Mar 2013 17:22:27 +0100

Hello,

Achim Gratz <address@hidden> writes:

> Am 27.03.2013 17:26, schrieb Nicolas Goaziou:
>> I think all newline characters should be replaced with a whitespace
>> character in macro arguments. Indeed, macro templates are only one line
>> long but unwanted "\n" could be inserted by paragraph filling in
>> arguments.
>
> I'm not sure about that, it would mean that there'd need to be
> additional syntax to insert linebreaks.

My point is that macro templates have to fit in a single line, no
newline character allowed. As a consequence, macro arguments are
implicitly expected to fit in a single line. So a newline character in
an argument is probably wrong.

>> I also don't mind trimming arguments again, provided this is added as an
>> explicit behaviour and there is no opposition to it.
>
> How about making trimming explicit during the expansion of macro
> arguments?  It seems that there are a few possibilities of what
> trimming could mean, so this would be an opportunity to allow them all
> (n is the argument number):
>
> $:n  - remove whitespace and linebreaks before argument
> $.n  - remove whitespace and linebreaks after argument
> $n   - same as $:.n
> $+n  - replace whitespace and linebreaks inside arguments
>        with a single space
> $*n  - same as $:+.n
> $~n  - literal argument (no trimming)

The current trend for macros is to be really simple so that advanced
(and not-so advanced) tasks are done with Babel instead. IOW, macros are
only useful if they are simpler than the simplest form of Babel usage.
In every other case, Babel is a superior choice.

Your suggestion is interesting, but I think it would go backwards wrt
this.


Regards,

-- 
Nicolas Goaziou



reply via email to

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