From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [ox-publish] handling of white space in arguments of macros, named arguments? Date: Thu, 28 Mar 2013 17:22:27 +0100 Message-ID: <87ehezxzng.fsf@gmail.com> References: <31F8FCDD-923C-402B-AD87-FEB6C8F84B12@nf.mpg.de> <87d2ukg66d.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFb1-0000J7-T7 for emacs-orgmode@gnu.org; Thu, 28 Mar 2013 12:22:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULFb0-00049t-75 for emacs-orgmode@gnu.org; Thu, 28 Mar 2013 12:22:35 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:51603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFb0-00049n-0o for emacs-orgmode@gnu.org; Thu, 28 Mar 2013 12:22:34 -0400 Received: by mail-wg0-f49.google.com with SMTP id e11so1648621wgh.4 for ; Thu, 28 Mar 2013 09:22:33 -0700 (PDT) In-Reply-To: (Achim Gratz's message of "Thu, 28 Mar 2013 07:59:38 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Achim Gratz Cc: emacs-orgmode@gnu.org Hello, Achim Gratz 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