From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: org-element-map no-recursion argument? Date: Thu, 30 Jan 2014 10:26:14 +0800 Message-ID: <4e38543e-3fe5-47f2-a166-abe4a7a8d98a@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8hKq-0007Ke-Th for emacs-orgmode@gnu.org; Wed, 29 Jan 2014 21:26:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8hKi-0002Px-G3 for emacs-orgmode@gnu.org; Wed, 29 Jan 2014 21:26:32 -0500 Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]:65198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8hKi-0002Pn-7S for emacs-orgmode@gnu.org; Wed, 29 Jan 2014 21:26:24 -0500 Received: by mail-pb0-f43.google.com with SMTP id md12so2549768pbc.16 for ; Wed, 29 Jan 2014 18:26:22 -0800 (PST) Received: from localhost ([113.103.27.174]) by mx.google.com with ESMTPSA id de3sm11756251pbb.33.2014.01.29.18.26.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 18:26:22 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: orgmode I've written some emacs-lisp using org-element-map to iterate over source=20 code blocks in an org buffer and insert them into another buffer, including=20= 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=20 section. More specifically -- I had moved some material into a "Removed" subtree=20 (with a tag "noexport"). This subtree contains some source blocks, but I=20 want my function to ignore these. I thought I could wrap the entire "Removed" section in #+begin/end_comment,=20= 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=20= between "live" and commented sections. I can work around it by commenting out the captions, but it would be nicer=20= to have an entire "off-limits" section of the document. hjh