From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Mikhanosha Subject: Re: shortcuts to hide nearest heading or sparse tree Date: Sun, 02 Oct 2011 09:53:22 -0400 Message-ID: <87zkhj33fx.wl%max@openchat.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAMTv-00016P-2R for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 09:53:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAMTt-0002mv-QJ for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 09:53:27 -0400 Received: from p84-72.acedsl.com ([66.114.84.72]:55846 helo=momoland.openchat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAMTt-0002mk-Kq for emacs-orgmode@gnu.org; Sun, 02 Oct 2011 09:53:25 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Kevin Buchs Cc: emacs-orgmode@gnu.org 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)))