emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] New exporter macro question


From: Nick Dokos
Subject: Re: [O] New exporter macro question
Date: Mon, 11 Feb 2013 09:43:12 -0500

Carsten Dominik <address@hidden> wrote:

> 
> On 11 feb. 2013, at 13:48, Carsten Dominik <address@hidden> 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
> > 
> >   <img src="./Content/Wiskunde/thumb.jpg" 
> > style="float:right;width:300px;margin:0px 20px 0px 20px;" 
> > alt="./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





reply via email to

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