emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Trevor Vartanoff <tv@codepuzzles.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Open Children of Children
Date: Sun, 27 May 2012 02:05:43 +0530	[thread overview]
Message-ID: <81pq9q1y00.fsf@gmail.com> (raw)
In-Reply-To: <4FC1301F.6030603@codepuzzles.org> (Trevor Vartanoff's message of "Sat, 26 May 2012 15:33:51 -0400")

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
>
>

-- 

      reply	other threads:[~2012-05-26 20:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-26 19:33 Open Children of Children Trevor Vartanoff
2012-05-26 20:35 ` Jambunathan K [this message]

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=81pq9q1y00.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tv@codepuzzles.org \
    /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).