From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: New exporter macro question Date: Mon, 11 Feb 2013 09:43:12 -0500 Message-ID: <31732.1360593792@alphaville> References: <8312EEB6-F657-449E-B025-167031ECACAC@gmail.com> <25A6F4AE-47C2-4D7E-9C84-3CC890B3937E@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4ubs-0000Rz-Ok for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 09:43:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4ubr-000740-1J for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 09:43:56 -0500 Received: from vms173015pub.verizon.net ([206.46.173.15]:25723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4ubq-0006xv-Qm for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 09:43:54 -0500 Received: from alphaville.dokosmarshall.org ([unknown] [108.7.96.134]) by vms173015.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MI200EL68W0IB30@vms173015.mailsrvcs.net> for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 08:43:13 -0600 (CST) In-reply-to: Message from Carsten Dominik of "Mon, 11 Feb 2013 14:45:24 +0100." <25A6F4AE-47C2-4D7E-9C84-3CC890B3937E@gmail.com> 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: Carsten Dominik Cc: "emacs-orgmode@gnu.org List" Carsten Dominik wrote: > > On 11 feb. 2013, at 13:48, Carsten Dominik wrote: > > > > > Hi, > > > > I am porting my websites to the new exporter, finally. Much is very smooth. I do have a problem with macros: > > > > > > * Macro definition > > > > > > #+MACRO: thumbright #+ATTR_HTML: style="float:right;width:$1;margin:0px 20px 0px 20px;" \n [[./Content/$2/thumb.jpg]] > > > > > > > > * Macro call > > > > {{{thumbright(300px,Wiskunde)}}} > > > > > > > > > > * This used to expand to > > > > ./Content/Wiskunde/thumb.jpg > > > > > > * But now it expands to nothing > > I am sure I am missing something basic. Thanks! > > OK, I see, this seems to be because the "\n" is no longer interpreted as a newline character upon macro expansion, so the entire text ends up in the ATTR_HTML line and is treated as a comment. > > Is there a way to get what I meant? > It seems to be coming from deep with emacs: if I create a buffer with x y z \ x y z and evaluate (with point somewhere on that line) (buffer-substring-no-properties (point-at-bol) (point-at-eol)) I get "x y z \\ x y z", so the backslash is escaped willy-nilly. This happens in org-element-keyword-parser. I don't know if the macro expansion would replace \n with a newline absent the extra backslash, but I'm sure that its presence does not help any. Nick