From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: deleting hidden parts of sparse trees Date: Tue, 8 Jul 2008 20:04:58 +0100 Message-ID: <20080708190458.GA17102@stats.ox.ac.uk> References: <20080707085512.GA10608@stats.ox.ac.uk> <4D539FB1-44C6-4E19-B7A4-C147ED623C0A@uva.nl> <20080708172008.GA11978@stats.ox.ac.uk> <2E800125-C30C-477E-AB79-01571C4C0D4D@uva.nl> 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 1KGIUo-0001Qg-BI for emacs-orgmode@gnu.org; Tue, 08 Jul 2008 15:05:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGIUl-0001QC-Vs for emacs-orgmode@gnu.org; Tue, 08 Jul 2008 15:05:01 -0400 Received: from [199.232.76.173] (port=53382 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGIUl-0001Q9-Qj for emacs-orgmode@gnu.org; Tue, 08 Jul 2008 15:04:59 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:38429) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KGIUl-0005zr-5W for emacs-orgmode@gnu.org; Tue, 08 Jul 2008 15:04:59 -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 m68J4wkQ004693 for ; Tue, 8 Jul 2008 20:04:58 +0100 (BST) Content-Disposition: inline In-Reply-To: <2E800125-C30C-477E-AB79-01571C4C0D4D@uva.nl> 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 On Tue, Jul 08, 2008 at 10:28:04AM -0700, Carsten Dominik wrote: > Hi Dan, this is very interesting. > > Maybe you would like to write a little document how you use Org for this > purpose, what your setup is, why you chose Org to do this etc and put it Yep, I'd be happy to. (It was somewhat pretentious of me to call my personal collection of random photos of flowers a 'database', but still happy to.) Dan > up on the web? I'd happily link to it from the Org webpages - we need > more of these examples. > > - Carsten > > On Jul 8, 2008, at 10:20 AM, Dan Davison wrote: > >> On Mon, Jul 07, 2008 at 09:48:37AM -0700, Carsten Dominik wrote: >>> >>> On Jul 7, 2008, at 9:44 AM, Carsten Dominik wrote: >>>> >> <...> >>>> >>>> Do I need to mention that this will be a dangerous operation, >>>> deleting >>>> lots of invisible text? You might find out only ater it is too late >>>> to recover. >>> >>> >>> Even much more dangerous then I thought, the command shown above >>> actually deletes anything covered by overlays, not only outline >>> overlays. Just one misplaced parenthesis...... >>> >>> Here is the corrected version. >>> >>> (defun outline-delete-invisible () >>> "Delete all text covered by overlays with `invisible' property >>> `outline'." >>> (interactive) >>> (let ((ovls (overlays-in (point-min) (point-max))) o) >>> (while (setq o (pop ovls)) >>> (and (eq (overlay-get o 'invisible) 'outline) >>> (delete-region (overlay-start o) (overlay-end o)))))) >>> >> >> Excellent! Thanks for the lesson. >> >> My motivation for the request is as follows. I have a 'master' org >> file (a database of plant photos arranged in a taxonomic hierarchy), >> and I want to publish it as html, together with html versions of >> various sparse trees derived from that master file according to tag >> matching criteria etc. One option would be to write my own publishing >> function, that creates each sparse tree and calls org-export-visible >> on it. But I'd be recoding a load of stuff that has already been >> addressed by org-publish. However, with the new function, I can create >> the org-files corresponding to the sparse trees, and then let >> org-publish-org-to-html deal with the master and the derived org files >> in one go, which is a much better solution IMO. >> >> DAn >> >> p.s. warning heeded: I copy to a temp buffer, create sparse tree >> and delete invisible in there.