emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug in new exporter with babel blocks


From: Nicolas Goaziou
Subject: Re: [O] Bug in new exporter with babel blocks
Date: Wed, 23 Jan 2013 14:28:44 +0100

Hello,


Aaron Ecay <address@hidden> writes:

> I’m dealing with a puzzling bug in the new exporter.  As background,
> I’ve written a custom function to process special-blocks, to replicate
> in the new exporter the functionality of the org-exp-blocks package
> (http://orgmode.org/worg/org-contrib/org-exp-blocks.html).

You needn't. org-exp-blocks functionalities are supported by the new
exporter out of the box.

> Because I need the un-processed text inside the special-block (not
> parsed into an org-elements structure nor escaped for LaTeX special
> characters),

Special blocks are de facto, recursive, much like drawers. Their
contents have to be parsed.

> I’m not sure if this is a long-standing problem or not; this is the
> first time I’ve combined babel with my custom special-blocks code.  I’m
> also at a loss of how to debug the internals of org-elements and
> org-export, two complex bits of machinery.  I guess the value of the
> :contents-begin and -end properties needs to be fixed in any case.

During export, the buffer being parsed isn't the original buffer,
because of babel block, include keywords and macros expansion. You may
want to have a look at `org-export-as' source code.

Hence, :contents-begin and :contents-end properties do not refer to real
buffer positions in the buffer from which `org-e-latex-special-block' is
called.

> I’d also be happy to discover another, better way of getting the raw
> text content of the special-block that doesn’t succumb to this
> problem.

If you must, you can try:

  (org-element-interpret-data (org-element-contents special-block))

from `org-e-latex-special-block'.


Regards,

-- 
Nicolas Goaziou



reply via email to

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