emacs-orgmode
[Top][All Lists]
Advanced

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

[O] org-element-map no-recursion argument?


From: James Harkins
Subject: [O] org-element-map no-recursion argument?
Date: Thu, 30 Jan 2014 10:26:14 +0800
User-agent: Trojita/v0.3.96-git; Qt/4.8.1; X11; Linux; Ubuntu 12.04.4 LTS

I've written some emacs-lisp using org-element-map to iterate over source code blocks in an org buffer and insert them into another buffer, including a listing number and caption (so it's different from tangling).

I was just trying to tweak it to ignore source code blocks in a comment section.

More specifically -- I had moved some material into a "Removed" subtree (with a tag "noexport"). This subtree contains some source blocks, but I want my function to ignore these.

I thought I could wrap the entire "Removed" section in #+begin/end_comment, and then tell org-element-map to skip comment blocks for recursion.

(org-element-map tree 'src-block (lambda (element) ...)
 nil nil 'comment)

But this has no effect. I guess the src-block filter erases the distinction between "live" and commented sections.

I can work around it by commenting out the captions, but it would be nicer to have an entire "off-limits" section of the document.

hjh



reply via email to

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