From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: M-RET inside the first second-level heading of the first first-level heading Date: Fri, 10 May 2013 08:49:19 +0200 Message-ID: References: <87bo917pej.fsf@bzg.ath.cx> <87txmf83j4.fsf@bzg.ath.cx> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uah8x-0000DP-SU for emacs-orgmode@gnu.org; Fri, 10 May 2013 02:49:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uah8v-00055h-Bs for emacs-orgmode@gnu.org; Fri, 10 May 2013 02:49:27 -0400 In-Reply-To: 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: Bastien , emacs-orgmode , Jisang Yoo On 7.5.2013, at 23:34, John Hendy wrote: > On Tue, May 7, 2013 at 4:54 AM, Bastien wrote: >> Hi John, >>=20 >> John Hendy writes: >>=20 >>> On Fri, Apr 26, 2013 at 1:54 AM, Bastien wrote: >>>> Hi Jisang, >>>>=20 >>>> Jisang Yoo writes: >>>>=20 >>>>> 2. Place cursor at the beginning of "** bacon" and press M-RET and = org creates >>>>> a first-level heading. >>>>=20 >>>> This should now be fixed. Thanks for reporting this, >>>=20 >>> There were some same/similar/related issues as well, and I'm still = not >>> getting perfect results. >>>=20 >>> Using a minimal config (below), if I create this in a new file >>>=20 >>> * test >>> ** test1 >>> ** test2 >>>=20 >>> and then fold on * test, I get this: >>>=20 >>> * test...2 >>=20 >> 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. >>=20 >>> 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? >>=20 >> 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. >=20 > Ah, that now makes sense. But... just to be clear, take this case: >=20 > * Headline1 > - list1 > - list2 >=20 > Now fold it: >=20 > * Headline1... >=20 > If I do M-RET at , I get: >=20 > * Headline1 > * > - list1 > - list2 >=20 > Is that how it's supposed to work? My use case is generally to have a > new headline after * Headline1 *and* it's contents, not putting > contents inside the new headline. >=20 > C-RET seems to behave more like I'd expect. In reading the manual, I > think I was just confused on usage based on the definition of C-RET, > however this in the description of M-RET is confusing: >=20 > #+begin_quote > If the command is used at the end of a folded subtree (i.e., behind > the ellipses at the end of a headline), then a headline like the > current one will be inserted after the end of the subtree. Calling > this command with C-u C-u will unconditionally respect the headline's > content and create a new item at the end of the parent subtree. > #+end_quote >=20 > It makes it seem like my original case in which the cursor is behind > (after?) the ... should insert a same-level headline after the end of > the current subtree (which I would assume means that headline and all > contents). Am I reading that incorrectly? It doesn't really talk about > the behavior if you're before the ellipsis. Yes, this is also a bit confusing. I think it would be desirable if it worked as described in the manual, but this is not what is happening. For now, I fixed the manual. - Carsten >=20 >=20 > Thanks for clarifying, > John >=20 >>=20 >>> 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. >>=20 >> 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, >>=20 >> -- >> Bastien >=20