emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Mikhanosha <max@openchat.com>
To: Kevin Buchs <kevin.buchs.junk@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: shortcuts to hide nearest heading or sparse tree
Date: Sun, 02 Oct 2011 09:53:22 -0400	[thread overview]
Message-ID: <87zkhj33fx.wl%max@openchat.com> (raw)
In-Reply-To: <CAEqjYhu_A5Z2TqarAdY9cV35Chfz5=pgmJKs-Vs9P0mnQPyn5Q@mail.gmail.com>

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 ()
  (outline-up-heading 1)

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

      reply	other threads:[~2011-10-02 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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:

  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=87zkhj33fx.wl%max@openchat.com \
    --to=max@openchat.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kevin.buchs.junk@gmail.com \


* 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


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