From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: deleting hidden parts of sparse trees Date: Mon, 7 Jul 2008 09:55:13 +0100 Message-ID: <20080707085512.GA10608@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KFmVB-0002dQ-LG for emacs-orgmode@gnu.org; Mon, 07 Jul 2008 04:55:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KFmVB-0002ck-3n for emacs-orgmode@gnu.org; Mon, 07 Jul 2008 04:55:17 -0400 Received: from [199.232.76.173] (port=46006 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFmVA-0002cT-PV for emacs-orgmode@gnu.org; Mon, 07 Jul 2008 04:55:16 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:59882) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KFmVA-0007v5-7K for emacs-orgmode@gnu.org; Mon, 07 Jul 2008 04:55:16 -0400 Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id m678tDM7020784 for ; Mon, 7 Jul 2008 09:55:13 +0100 (BST) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs org-mode mailing list I'd like to be able to create a 'pruned' tree -- I am thinking of an operation that is similar to sparse tree creation, but which results in the deletion (not just folding) of all subtrees that contain no matching entries. I don't think this currently exists as such (?), but it is possible to do what I want by (1) creating a sparse tree, and (2) org-export-visible, selecting the 'keep-buffer' option. So that's good. However, I don't know how to do it programmatically, because org-export-visible has interactive keyboard input. (Or am I just exposing my ignorance here??) I've looked at the code, and what occurs to me is to hack out the middle bit of org-export-visible as a separate function, say org-prune-invisible or something. I sort of tried. It, err, didn't work. Anyone think this would be worth doing? (The functionality, if not via my suggested route) Dan