From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: M-RET inside the first second-level heading of the first first-level heading Date: Tue, 07 May 2013 11:54:45 +0200 Message-ID: <87txmf83j4.fsf@bzg.ath.cx> References: <87bo917pej.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZfWT-0003Uw-RC for emacs-orgmode@gnu.org; Tue, 07 May 2013 06:53:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZfWR-0000UZ-LC for emacs-orgmode@gnu.org; Tue, 07 May 2013 06:53:29 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:42996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZfWR-0000U8-Eq for emacs-orgmode@gnu.org; Tue, 07 May 2013 06:53:27 -0400 Received: by mail-wi0-f178.google.com with SMTP id hm14so451594wib.17 for ; Tue, 07 May 2013 03:53:26 -0700 (PDT) In-Reply-To: (John Hendy's message of "Thu, 2 May 2013 13:51:26 -0500") 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: John Hendy Cc: Jisang Yoo , emacs-orgmode Hi John, John Hendy writes: > On Fri, Apr 26, 2013 at 1:54 AM, Bastien wrote: >> Hi Jisang, >> >> Jisang Yoo writes: >> >>> 2. Place cursor at the beginning of "** bacon" and press M-RET and org creates >>> a first-level heading. >> >> This should now be fixed. Thanks for reporting this, > > There were some same/similar/related issues as well, and I'm still not > getting perfect results. > > Using a minimal config (below), if I create this in a new file > > * test > ** test1 > ** test2 > > and then fold on * test, I get this: > > * test...2 I do have (setq require-final-newline t) in my config, which prevents this. What happens is this: if you don't have the config above, the folding will get wrong and display the "2" from the end of the buffer. > Also, after navigating to the end of * test...2 (with it folded) and > issuing M-RET, I get a new second level heading after ** test2. I > would have expected a new first level headline since I did M-RET on a > first level headline. Or is that the default behavior? If you are before the "..." ellipsis, you are on a first level headline and M-RET will insert a first level headline. Otherwise you are on a second level headline ("test2") and it will insert a second level headline. > If so, I guess my only concern is the folding of the end of a headline > if there's no hard return after it into the ellipsis of it's parent. Yes. Maybe M-RET could/should handle this corner-case but since `org-insert-heading' is deserving a full rewrite, I'm not going to try to handle this corner-case myself... let's just keep it in mind when doing the rewrite. Thanks for spotting it, -- Bastien