Hello, Fabrice Popineau <fabrice.popin...@gmail.com> 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