emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* shortcuts to hide nearest heading or sparse tree
@ 2011-09-16 22:32 Kevin Buchs
  2011-09-25  0:55 ` Kevin Buchs
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buchs @ 2011-09-16 22:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

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?

[-- Attachment #2: Type: text/html, Size: 339 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* shortcuts to hide nearest heading or sparse tree
  2011-09-16 22:32 shortcuts to hide nearest heading or sparse tree Kevin Buchs
@ 2011-09-25  0:55 ` Kevin Buchs
  2011-10-02 13:53   ` Max Mikhanosha
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buchs @ 2011-09-25  0:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

Reposting due to no replies:

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?

[-- Attachment #2: Type: text/html, Size: 385 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: shortcuts to hide nearest heading or sparse tree
  2011-09-25  0:55 ` Kevin Buchs
@ 2011-10-02 13:53   ` Max Mikhanosha
  0 siblings, 0 replies; 3+ messages in thread
From: Max Mikhanosha @ 2011-10-02 13:53 UTC (permalink / raw)
  To: Kevin Buchs; +Cc: emacs-orgmode

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)))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-02 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 22:32 shortcuts to hide nearest heading or sparse tree Kevin Buchs
2011-09-25  0:55 ` Kevin Buchs
2011-10-02 13:53   ` Max Mikhanosha

Code repositories for project(s) associated with this 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).