emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] how can I insert a new heading after all at this level?


From: Nick Dokos
Subject: Re: [O] how can I insert a new heading after all at this level?
Date: Tue, 19 Feb 2013 17:36:08 -0500

David Naumann <address@hidden> wrote:

> I'm a happy, frequent user of org mode but there's something I can't
> figure out from the manual.
> 
> What I would like to be able to do is insert a new heading at the same
> level as current, _following_ all the others.  For example, with the
> cursor on the A in this tree:
> 
>     * top
> ->  ** A
>     ** B
>     ** C
>     * next
> 
> I would like to insert a last sibling and move to it:
> 
>     * top
>     ** A
>     ** B
>     ** C
> ->  **
>     * next
> 
> Use case: adding to a very long chronological list.  I have not seen a
> quick way to do this using the structure motion/editing commands in
> the manual, without scrolling in one way or another.
> 
> If you have a hint, please reply to my address; I'm not on this
> mailing list.
> 

>From somewhere in the second level (but not in the third or higher levels, if 
>such
exist), you can go up to the higher-level heading (what you call top), then to 
the
next heading at the same level (next), open a line before that and insert a 
heading:

C-c C-u
C-c C-f
C-o
M-RET

If typing all that is objectionable, you can define a keyboard macro to
do it. 

Or you can define a command to do it (I just looked up the
above key bindings to find the functions to call and looked up the docs
of the various functions for the arguments):

(defun my-org-insert-heading-at-end-of-current-level ()
  (interactive)
  (outline-up-heading 1)
  (org-forward-heading-same-level 1)
  (open-line 1)
  (org-meta-return))

and either call it with M-x my-org-insert-heading-at-end-of-current-level RET
or bind it to a key.

Nick






reply via email to

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