* Add C-u behavior to <C-return>?
@ 2018-02-27 16:42 Kaushal Modi
2018-02-27 18:04 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Kaushal Modi @ 2018-02-27 16:42 UTC (permalink / raw)
To: emacs-org list
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
Hello,
Lately, I have seen myself end up in a scenario where the point is at | as
shown below, and I need to insert an Org heading at point.
=====
* heading
- list item
|
content
=====
Currently, I cannot any way to insert heading at point while *not
respecting* the content, when the point is *immediately* after a list item.
C-return, C-u C-return, M-return, C-u M-return, none work.
I see that C-u C-return is "free".
C-return is bound to `org-insert-heading-respect-content ' whose definition
is simply:
(defun org-insert-heading-respect-content (&optional invisible-ok)
"Insert heading with `org-insert-heading-respect-content' set to t."
(interactive)
(org-insert-heading '(4) invisible-ok))
Would a patch be accepted that passes nil as ARG to org-insert-heading,
instead of '(4)?
-----
I am aware that M-return does what I want if I first manully insert
newlines after a list to "break" the list (by first moving the point as
shown below).
=====
* heading
- list item
| (now do M-return)
content
=====
But still, having C-u C-return binding would be nicer..
--
Kaushal Modi
[-- Attachment #2: Type: text/html, Size: 1527 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Add C-u behavior to <C-return>?
2018-02-27 16:42 Add C-u behavior to <C-return>? Kaushal Modi
@ 2018-02-27 18:04 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2018-02-27 18:04 UTC (permalink / raw)
To: Kaushal Modi; +Cc: emacs-org list
Hello,
Kaushal Modi <kaushal.modi@gmail.com> writes:
> Lately, I have seen myself end up in a scenario where the point is at | as
> shown below, and I need to insert an Org heading at point.
>
> =====
> * heading
> - list item
> |
> content
> =====
>
> Currently, I cannot any way to insert heading at point while *not
> respecting* the content, when the point is *immediately* after a list item.
>
> C-return, C-u C-return, M-return, C-u M-return, none work.
>
> I see that C-u C-return is "free".
>
> C-return is bound to `org-insert-heading-respect-content ' whose definition
> is simply:
>
> (defun org-insert-heading-respect-content (&optional invisible-ok)
> "Insert heading with `org-insert-heading-respect-content' set to t."
> (interactive)
> (org-insert-heading '(4) invisible-ok))
>
> Would a patch be accepted that passes nil as ARG to org-insert-heading,
> instead of '(4)?
My gut feeling is that we should first try to rationalize functions for
`M-RET' and `C-RET' along with all their prefix arguments. For example,
the behaviour you describe might be better served with `C-u M-RET', as
in "insert a headline right here, whatever that means".
I don't suggest to change `M-RET' itself, but I'm sure we can discuss
about what can be done with the other relative bindings.
I don't think C-RET is available in a terminal either. It may limit us
about what we can do with it.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-27 18:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27 16:42 Add C-u behavior to <C-return>? Kaushal Modi
2018-02-27 18:04 ` Nicolas Goaziou
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).