Hello,

Achim Gratz <strom...@nexgo.de> 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