From: Dan Davison <davison@stats.ox.ac.uk>
To: Scot Becker <scot.becker@gmail.com>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: FR: org-hide-context
Date: Wed, 16 Dec 2009 13:58:56 -0500 [thread overview]
Message-ID: <87zl5ioidr.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <e0e1fe620912161038y422c4354k406669e47852fe2b@mail.gmail.com> (Scot Becker's message of "Wed, 16 Dec 2009 18:38:07 +0000")
Scot Becker <scot.becker@gmail.com> writes:
> I like that, too.
>
>
> On Wed, Dec 16, 2009 at 3:58 PM, Adam Spiers <orgmode@adamspiers.org> wrote:
>
> It would be great to have an opposite to `org-reveal' which folded all
> siblings, ancestors, and maybe even all ancestors' siblings of the
> current headline. A suitable key-binding might be C-u C-u C-c C-r
> or similar.
Are these speed commands at all similar to what you have in mind?
***** Speed commands
#+begin_src emacs-lisp
(defun ded/org-show-next-heading-tidily ()
"Show next entry, keeping other entries closed."
(if (save-excursion (end-of-line) (outline-invisible-p))
(progn (org-show-entry) (show-children))
(outline-next-heading)
(unless (and (bolp) (org-on-heading-p))
(org-up-heading-safe)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-show-entry)
(show-children)))
(defun ded/org-show-previous-heading-tidily ()
"Show previous entry, keeping other entries closed."
(let ((pos (point)))
(outline-previous-heading)
(unless (and (< (point) pos) (bolp) (org-on-heading-p))
(goto-char pos)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-show-entry)
(show-children)))
(setq org-use-speed-commands t)
(add-to-list 'org-speed-commands-user
'("n" ded/org-show-next-heading-tidily))
(add-to-list 'org-speed-commands-user
'("p" ded/org-show-previous-heading-tidily))
#+end_src
Dan
>
> Thanks,
> Adam
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2009-12-16 18:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 15:58 FR: org-hide-context Adam Spiers
2009-12-16 18:38 ` Scot Becker
2009-12-16 18:58 ` Dan Davison [this message]
2010-01-01 10:38 ` Carsten Dominik
2010-01-01 13:21 ` Scot Becker
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=87zl5ioidr.fsf@stats.ox.ac.uk \
--to=davison@stats.ox.ac.uk \
--cc=emacs-orgmode@gnu.org \
--cc=scot.becker@gmail.com \
/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).