From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [feature request] org-insert-heading Date: Sat, 11 Feb 2012 10:23:46 +0100 Message-ID: <87vcndsoyl.fsf@gmail.com> References: <87hayy8lsh.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw9DT-0004T3-Bl for emacs-orgmode@gnu.org; Sat, 11 Feb 2012 04:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rw9DS-0002BS-7w for emacs-orgmode@gnu.org; Sat, 11 Feb 2012 04:25:59 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:61874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw9DS-0002BM-3Q for emacs-orgmode@gnu.org; Sat, 11 Feb 2012 04:25:58 -0500 Received: by wera13 with SMTP id a13so3113813wer.0 for ; Sat, 11 Feb 2012 01:25:56 -0800 (PST) In-Reply-To: <87hayy8lsh.fsf@Rainer.invalid> (Achim Gratz's message of "Fri, 10 Feb 2012 21:40:14 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Achim Gratz Cc: emacs-orgmode@gnu.org Hello, Achim Gratz 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