emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] shortcuts to hide nearest heading or sparse tree


From: Max Mikhanosha
Subject: Re: [O] shortcuts to hide nearest heading or sparse tree
Date: Sun, 02 Oct 2011 09:53:22 -0400
User-agent: Wanderlust/2.15.3 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.3.50 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Sat, 24 Sep 2011 19:55:37 -0500,
Kevin Buchs wrote:

> I have been studying extensively and have not found a quick way to hide the 
> nearest heading (which
> contains point) as well as the entire sparse tree. I often have two or more 
> sparse trees open as I go
> look for information elsewhere and then want to return to the place I was at. 
> So, can I be lazy and
> do these operations with a few keys?

C-c C-u then M-x hide-subtree would close parent heading.. You can do

(defun close-parent-heading ()
  (interactive)
  (outline-up-heading 1)
  (hide-subtree))

then bind it to a key.
  
If you want to hide parent headings until you reach certain condition, then 
you'll
have to write a more complicated function like so:

(defun fold-until-tagged-blah ()
  "Fold headings containing point upward until heading tagged :blah"
  (interactive)
  (org-back-to-heading)
  (let (done)
    (while (not done)
      (cond ((member "blah" (org-get-tags-at nil t))
             (setq done t))
            ((not (org-up-heading-safe))
             (setq done t))))             
    (org-hide-subtree)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]