emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Export filters question


From: Nicolas Goaziou
Subject: Re: [O] Export filters question
Date: Mon, 15 Sep 2014 18:30:05 +0200

Hello,

Fabrice Popineau <address@hidden> writes:

> This is probably a very basic question,
> but what is the right way to access properties of the element in a filter ?
>
> Admit I want to define my own filter:
>
> (defun my-latex-filter-headline (text backend info)
>  ... )
>
> And I want to access the relative level of the current headline. How should
> I do it?

Short answer. You can't.

Long answer. Actually, `info' contains the full parse tree (plist-get
info :parse-tree) so you could be able to retrieve the headline
currently being exported (since export results are cached
in :exported-data, an untested idea would be to walk the tree with
`org-element-map' and find the last headline without an entry in the
cache). It is also probably bound to `data' per dynamic binding, but
I wouldn't count on that as it might change in the future.

Since filters are meant for tweaking generated output, the information
you're looking after is not readily accessible at this level. Your
request makes sense, but I think you really want to write a derived
back-end with a custom headline transcoder instead.


Regards,

-- 
Nicolas Goaziou



reply via email to

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