From: Carsten Dominik <dominik@uva.nl>
To: Dan Davison <davison@stats.ox.ac.uk>
Cc: emacs org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: deleting hidden parts of sparse trees
Date: Mon, 7 Jul 2008 09:44:16 -0700 [thread overview]
Message-ID: <4D539FB1-44C6-4E19-B7A4-C147ED623C0A@uva.nl> (raw)
In-Reply-To: <20080707085512.GA10608@stats.ox.ac.uk>
On Jul 7, 2008, at 1:55 AM, Dan Davison wrote:
> 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 (?),
No, it does not.
> 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.
That is a possibility, but for your task a much more direct way would be
to iterate directly over the overlays in the buffer and to delete text
accordingly.
(defun outline-delete-invisible ()
"Delete all text covert 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)))))
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.
HTH
- Carsten
next prev parent reply other threads:[~2008-07-07 16:44 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 [this message]
2008-07-07 16:48 ` Carsten Dominik
2008-07-08 17:20 ` Dan Davison
[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=4D539FB1-44C6-4E19-B7A4-C147ED623C0A@uva.nl \
--to=dominik@uva.nl \
--cc=davison@stats.ox.ac.uk \
--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).