emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [feature request] org-insert-heading
Date: Sat, 11 Feb 2012 10:23:46 +0100	[thread overview]
Message-ID: <87vcndsoyl.fsf@gmail.com> (raw)
In-Reply-To: <87hayy8lsh.fsf@Rainer.invalid> (Achim Gratz's message of "Fri, 10 Feb 2012 21:40:14 +0100")

Hello,

Achim Gratz <Stromeko@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	other threads:[~2012-02-11  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 20:40 [feature request] org-insert-heading Achim Gratz
2012-02-11  9:23 ` Nicolas Goaziou [this message]
2012-02-11 17:43   ` Achim Gratz
2012-02-11 18:00     ` Bernt Hansen
2012-02-11 18:17       ` Achim Gratz
2012-02-12  8:19     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vcndsoyl.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).