emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Open Children of Children


From: Jambunathan K
Subject: Re: [O] Open Children of Children
Date: Sun, 27 May 2012 02:05:43 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (windows-nt)

Trevor Vartanoff <address@hidden> 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
>
>

-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]