emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Bug in new exporter with babel blocks
Date: Wed, 23 Jan 2013 14:28:44 +0100	[thread overview]
Message-ID: <87ehhc9gfn.fsf@gmail.com> (raw)
In-Reply-To: <87obggevdz.fsf@gmail.com> (Aaron Ecay's message of "Tue, 22 Jan 2013 16:54:32 -0500")


Aaron Ecay <aaronecay@gmail.com> 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

> 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'.


Nicolas Goaziou

  reply	other threads:[~2013-01-23 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 21:54 Aaron Ecay
2013-01-23 13:28 ` Nicolas Goaziou [this message]
2013-02-21 18:11   ` Aaron Ecay
2013-04-20 19:32     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehhc9gfn.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Bug in new exporter with babel blocks' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).