From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nuutti Kotivuori Subject: "Create new heading after this one" command Date: Tue, 18 Sep 2007 18:45:59 +0300 Message-ID: <87y7f4t1s8.fsf@aka.i.naked.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXfIP-0003GO-Ie for emacs-orgmode@gnu.org; Tue, 18 Sep 2007 11:47:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXfIN-0003Fs-RZ for emacs-orgmode@gnu.org; Tue, 18 Sep 2007 11:47:29 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXfIN-0003Fp-M9 for emacs-orgmode@gnu.org; Tue, 18 Sep 2007 11:47:27 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IXfIM-0005sF-UY for emacs-orgmode@gnu.org; Tue, 18 Sep 2007 11:47:27 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IXfHy-00005I-UP for emacs-orgmode@gnu.org; Tue, 18 Sep 2007 17:47:03 +0200 Received: from naked.iki.fi ([62.142.249.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Sep 2007 17:47:02 +0200 Received: from naked by naked.iki.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Sep 2007 17:47:02 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Very often I end up in a situation where I'm at a heading, and need to create a new heading after this one, with the same level. But this seems to be overly difficult in some cases. I am pointing out a few problems with an example layout of this: * Heading ** Item 1... ** Ite[1]m 2 - Text - Other[2] text - More text *** Subitem 1 *** Subitem 2 ** Item 3[3]... * Another heading (I'm using [x] to mark possible positions for the point, which I outline below.) In the [1] case, the point is currently in the middle of the "Item 2" heading. To get what I want, I need to do C-a to get to the beginning of the line, then M-RET to get a new bullet item which appears *before* "Item 2" and then press M-down to make it be after "Item 2" and before "Item 3". I could, alternatively, move to the beginning of the "Item 3" line and press M-RET, but for me that's counter intuitive - and it wouldn't work if I wanted an item below "Item 3". And if I do the thing that would be intuitive for me - that is, moving to the end of "Item 2" with C-e and pressing M-RET, I get a new item after "Item 2", but the notes I had with "Item 2" Become notes for the *new* item - which is not what I want. In the [2] case, things are even more difficult. Pressing M-RET creates new list items, so I first need to navigate myself out to somewhere where there's a heading and then do the same thing as before. In the [3] case, behaviour is actually really broken. If the item is folded, pressing C-e will bring me just before the "..." signifying the folded status. If I press M-RET there, the point just mysteriously gets moved to the end of the line (after "..."). If I start typing there and go around changing folding a number of different things can happen - worst of which is losing the entire subtree under "Item 3"! (This can be reproduced by: M-RET "foobar" C-a TAB) For this, all, I have two alternative suggestions: Either: Make C-e M-RET consistently make a new heading below the current one - regardless of folding and leaving any text associated with the current heading alone. But this may be difficult, considering that folding seems to be a bit troublesome at times. Or, simply: Add a new command which creates a new heading after the current one, regardless where the point is on the line, at the same level the current heading is. This command could work also in the text part of headings, like lists - always creating headings, unlike M-RET. Prefix argument on this command could create the heading before the current one, though I'm not sure if it would be terribly useful. A variation, creating a subheading (one level deeper) of the current item could be useful, but since that can be achieved with the former by just pressing M-right after the command, I don't think this one is too useful either. I've run into this problem ever since I started using org-mode - so I thought others might have the same problem. If not, I can hack this trivially for myself only. Thank you for your time, -- Naked