[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Speed commands
From: |
Dan Davison |
Subject: |
Re: [Orgmode] Speed commands |
Date: |
Sat, 14 Nov 2009 21:44:02 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Dan Davison <address@hidden> writes:
> Carsten Dominik <address@hidden> writes:
>
> <...>
>> I am happy to have a discussion what additional
>> commands should be present by default.
>
> I thought a speed command for scrolling through an org document might be
> good -- move from heading to heading, displaying the next entry while
> keeping all others hidden, and close subtrees as you leave them.
Here are simplified versions of the forward- and backward-scroll speed
commands that I'm suggesting.
---------------------------------------------------------
(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))
---------------------------------------------------------
Dan
> Or is
> there already an org command that does something like this?
>
> (Try starting with everything closed.)
>
> --------------------------------------------------------------
> (defun ded/org-show-next-heading-tidily ()
> "Show next entry, keeping other entries closed."
> (if (save-excursion (end-of-line) (outline-invisible-p))
> (org-cycle)
> (let ((level (org-current-level)))
> (unless (org-heading-has-child-p) (org-cycle))
> (outline-next-heading)
> (if (< (org-current-level) level)
> (save-excursion
> (outline-backward-same-level 1)
> (org-cycle)))
> (if (and (bolp) (org-on-heading-p))
> (org-cycle)
> (outline-up-heading 1 t)
> (org-cycle)
> (error "Boundary reached")))))
>
> (setq org-use-speed-commands t)
> (add-to-list 'org-speed-commands-user
> '("s" ded/org-show-next-heading-tidily))
> --------------------------------------------------------------
>
> (<space> might be quite natural for this one, it seems to get used for
> scrolling e.g. in dired and gnus)
>
> Dan
>
>
>>
>> - Carsten
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
- Re: [Orgmode] Release 6.33, (continued)
- Re: [Orgmode] Release 6.33, Eric S Fraga, 2009/11/13
- Re: [Orgmode] Release 6.33, Carsten Dominik, 2009/11/13
- Re: [Orgmode] Release 6.33, Carsten Dominik, 2009/11/13
- Re: [Orgmode] Speed commands, Dan Davison, 2009/11/14
- [Orgmode] Re: Speed commands, Benjamin Andresen, 2009/11/14
- Re: [Orgmode] Re: Speed commands, Dan Davison, 2009/11/14
- Re: [Orgmode] Speed commands,
Dan Davison <=
- [Orgmode] Re: Speed commands, Benjamin Andresen, 2009/11/15
- Re: [Orgmode] Speed commands, Carsten Dominik, 2009/11/15
- [Orgmode] Re: Speed commands, J. David Boyd, 2009/11/17
- [Orgmode] Re: Speed commands, J. David Boyd, 2009/11/17
- Re: [Orgmode] Re: Speed commands, Dan Davison, 2009/11/17
- Re: [Orgmode] Re: Speed commands, Carsten Dominik, 2009/11/17
- Re: [Orgmode] Speed commands, Jason Dunsmore, 2009/11/18
- Re: [Orgmode] Speed commands, Carsten Dominik, 2009/11/18
- Re: [Orgmode] Speed commands (was: Release 6.33), Friedrich Delgado Friedrichs, 2009/11/20
- Re: [Orgmode] Speed commands (was: Release 6.33), Carsten Dominik, 2009/11/20