[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] FR: org-hide-context
From: |
Dan Davison |
Subject: |
Re: [Orgmode] FR: org-hide-context |
Date: |
Wed, 16 Dec 2009 13:58:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Scot Becker <address@hidden> writes:
> I like that, too.
>
>
> On Wed, Dec 16, 2009 at 3:58 PM, Adam Spiers <address@hidden> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode