emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: Carsten Dominik <dominik@uva.nl>
Cc: emacs org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: deleting hidden parts of sparse trees
Date: Tue, 8 Jul 2008 18:20:08 +0100	[thread overview]
Message-ID: <20080708172008.GA11978@stats.ox.ac.uk> (raw)
In-Reply-To: <F11294FE-384E-4E54-AF75-0C5E6D15696F@uva.nl>

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.

  reply	other threads:[~2008-07-08 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07  8:55 deleting hidden parts of sparse trees Dan Davison
2008-07-07 16:44 ` Carsten Dominik
2008-07-07 16:48   ` Carsten Dominik
2008-07-08 17:20     ` Dan Davison [this message]
     [not found]       ` <2E800125-C30C-477E-AB79-01571C4C0D4D@uva.nl>
2008-07-08 19:04         ` Dan Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080708172008.GA11978@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=dominik@uva.nl \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).