emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [feature request] org-insert-heading


From: Nicolas Goaziou
Subject: Re: [O] [feature request] org-insert-heading
Date: Sat, 11 Feb 2012 10:23:46 +0100

Hello,

Achim Gratz <address@hidden> writes:

> The command M-RET actually does what it's docstring says (insert before
> when point is at BOL, split line when it is inside), but there is
> inconsistent behaviour when point is at EOL, IMHO. Consider the
> following list (or equivalent headline structure), with point after
> "aaaa":
>
> - aaaa
>   + abbb
>   + accc
>
> Using org-insert-heading and entering "bbbb" will produce this:
>
> - aaaa
> - bbbb
>   + abbb
>   + accc
>
> In doing so, the subtree of "aaaa" has been transferred to the new
> heading, which is almost never what I want (and could easily be done by
> appending the new list or headline text and then splitting the line).  I
> would expect that the subtree of "aaaa" is considered as a unit when
> inserting a new headline with point at EOL (just like all moving
> commands would do and the result should be this:
>
> - aaaa
>   + abbb
>   + accc
> - bbbb
>
> Could org-insert-heading be extended to handle this situation as I
> outlined?

By default, M-RET is allowed to split lines, and therefore contents. You
may use the following to achieve the desired effect:

--8<---------------cut here---------------start------------->8---
(setq org-M-RET-may-split-line '((item) (default . t)))
--8<---------------cut here---------------end--------------->8---


Regards,

-- 
Nicolas Goaziou



reply via email to

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