* Open Children of Children
@ 2012-05-26 19:33 Trevor Vartanoff
2012-05-26 20:35 ` Jambunathan K
0 siblings, 1 reply; 2+ messages in thread
From: Trevor Vartanoff @ 2012-05-26 19:33 UTC (permalink / raw
To: emacs-orgmode
I've been using this macro on headings to open the subtree to the
children of children, since org-cycle just goes "nothing -> children -
everything":
(fset 'och ;; Open children of children
[tab tab ?\C-n M-return ?\C-b ?* ?\C-a ?\C-p tab tab ?\C-n ?\C-k
?\C-k ?\C-p])
Is there a more elegant solution available? If not, hopefully some of
you find this useful as well.
Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Open Children of Children
2012-05-26 19:33 Open Children of Children Trevor Vartanoff
@ 2012-05-26 20:35 ` Jambunathan K
0 siblings, 0 replies; 2+ messages in thread
From: Jambunathan K @ 2012-05-26 20:35 UTC (permalink / raw
To: Trevor Vartanoff; +Cc: emacs-orgmode
Trevor Vartanoff <tv@codepuzzles.org> writes:
> I've been using this macro on headings to open the subtree to the
> children of children, since org-cycle just goes "nothing -> children -
> everything":
>
> (fset 'och ;; Open children of children
> [tab tab ?\C-n M-return ?\C-b ?* ?\C-a ?\C-p tab tab ?\C-n ?\C-k
> ?\C-k ?\C-p])
>
> Is there a more elegant solution available? If not, hopefully some of
> you find this useful as well.
You are looking for `org-goto-first-child' (which is a non-interactive
defun)
Here is what I have in my .emacs. It uses speed commands and "d" is
bound to "descend" in to a subtree.
(defun jambu/org-goto-next-sibling ()
(org-goto-sibling)
(org-overview)
(org-reveal)
(beginning-of-line)
(re-search-forward "[*]+")
(backward-char))
(defun jambu/org-goto-previous-sibling ()
(org-goto-sibling t)
(org-overview)
(org-reveal)
(beginning-of-line)
(re-search-forward "^[*]+")
(backward-char))
(defun jambu/org-goto-first-child ()
(org-goto-first-child)
(org-overview)
(org-reveal)
(beginning-of-line)
(re-search-forward "^[*]+")
(backward-char))
(setq org-use-speed-commands t)
(add-to-list 'org-speed-commands-user
'("n" jambu/org-goto-next-sibling))
(add-to-list 'org-speed-commands-user
'("p" jambu/org-goto-previous-sibling))
(add-to-list 'org-speed-commands-user
'("d" jambu/org-goto-first-child))
> Thanks
>
>
--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-26 20:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-26 19:33 Open Children of Children Trevor Vartanoff
2012-05-26 20:35 ` Jambunathan K
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.