unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* C-o (was: Proposal: new default bindings for winner and windmove)
  2024-07-02  1:00                   ` Po Lu
@ 2024-07-02  3:26                     ` Stefan Monnier
  2024-07-02 22:31                       ` Stefan Kangas
  2024-07-03 10:07                       ` Per Starbäck
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Monnier @ 2024-07-02  3:26 UTC (permalink / raw)
  To: Po Lu
  Cc: Daniel Colascione, Alan Mackenzie, Dmitry Gutov, Stefan Kangas,
	emacs-devel

>> I still think we need to find a better binding for C-o, FWIW.
[...]
>> What do you use it for?

I'm also curious to know how people use `C-o`, which I never ever use.

> What do you expect?  Opening a new line?

Not sure what answer Daniel was looking for, but for me at least the
question is about the "context" where you use `C-o`.  E.g. I can see
someone doing

    C-o foo bar

but I don't see the benefit compared to

    foo bar RET

It probably comes down to habit, but I'm hoping there's more to it
than that.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C-o (was: Proposal: new default bindings for winner and windmove)
  2024-07-02  3:26                     ` C-o (was: Proposal: new default bindings for winner and windmove) Stefan Monnier
@ 2024-07-02 22:31                       ` Stefan Kangas
  2024-07-03 10:07                       ` Per Starbäck
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2024-07-02 22:31 UTC (permalink / raw)
  To: Stefan Monnier, Po Lu
  Cc: Daniel Colascione, Alan Mackenzie, Dmitry Gutov, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Not sure what answer Daniel was looking for, but for me at least the
> question is about the "context" where you use `C-o`.  E.g. I can see
> someone doing
>
>     C-o foo bar
>
> but I don't see the benefit compared to
>
>     foo bar RET
>
> It probably comes down to habit, but I'm hoping there's more to it
> than that.

When I want to insert a new line above the current one, the easiest way
is two keys:

    C-a C-o

Without C-o, I'd need to use three keys:

    C-a RET <up>

I also use it to split lines and keep point at the current location.
For example, when in the middle of some line, I press

    C-o

Instead of

    RET <left>

It's minor, admittedly, but I'm so used to it that I'd miss it if I
didn't have it.  Vim has similar commands on o and O, IIRC.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: C-o (was: Proposal: new default bindings for winner and windmove)
  2024-07-02  3:26                     ` C-o (was: Proposal: new default bindings for winner and windmove) Stefan Monnier
  2024-07-02 22:31                       ` Stefan Kangas
@ 2024-07-03 10:07                       ` Per Starbäck
  1 sibling, 0 replies; 4+ messages in thread
From: Per Starbäck @ 2024-07-03 10:07 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Po Lu, Daniel Colascione, Alan Mackenzie, Dmitry Gutov,
	Stefan Kangas, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

>
>  I can see
> someone doing
>
>     C-o foo bar
>
> but I don't see the benefit compared to
>
>     foo bar RET
>
> It probably comes down to habit, but I'm hoping there's more to it
> than that.
>

I have realized I want to add more text somewhere in the text:
----------------------------------------------------------------------
This is the beginning of the text before the insertion. Here is the
end of the text, after the insertion.
----------------------------------------------------------------------
Point is on "H" in "Here". Before typing the new text I do C-o to get the
continuation out of the way while typing. I wouldn't do that if I'm just
adding something short, but if I'm adding a longer text I would.
In programming I would also do that if adding something longer or something
complicated. It feels better to be at the end of the line when adding text
than to push text in front of you, which can look a bit disturbing,
especially if it is long enough to be broken over to the next line.

I guess this is mostly by habit, but I see at least some advantages of
entering text at the end of the line. Then it's easier to C-e back to point
of entry if I go back to revise something just written, and I can use the
special case of C-t  for quick fixing. Also pushing text in front of me
will be a problem for ispell-word and other commands that look up the
current word. I could make sure to position myself before a space to avoid
that problem, but that would be an extra step to make where just C-o is
simpler.

[-- Attachment #2: Type: text/html, Size: 1912 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* C-o (was: Proposal: new default bindings for winner and windmove)
@ 2024-07-03 19:32 Johan Myréen
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Myréen @ 2024-07-03 19:32 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 762 bytes --]

>
> I can see someone doing C-o foo bar but I don't see the benefit compared
> to foo bar RET


The benefit is that C-o opens a new blank line to type on, instead of
prepending what you are writing to the pre-existing text on the line, which
I find very distracting. Also, I might want to do a quick edit to what I
have typed so far (maybe to fix a typo before I forget it's there), and
then return to add new text to the line. If I open a new blank line with
C-o, I just type C-e to continue typing, but if the line is still stringed
together with the old line, then finding the correct point is a pita.

Note that the vi editor also has not only one, but two "open line" commands
"o" and "O", for opening a line below and above the current line,
respectively.

[-- Attachment #2: Type: text/html, Size: 1018 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-03 19:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 19:32 C-o (was: Proposal: new default bindings for winner and windmove) Johan Myréen
  -- strict thread matches above, loose matches on Subject: below --
2021-08-21 19:10 Proposal: new default bindings for winner and windmove Daniel Colascione
2021-08-22 17:52 ` Stefan Monnier
2024-06-21 19:03   ` Stefan Monnier
2024-06-21 20:39     ` Stefan Kangas
2024-06-26 15:48       ` Stefan Monnier
2024-07-01  1:29         ` Stefan Kangas
2024-07-01 10:07           ` Alan Mackenzie
2024-07-01 11:25             ` Dmitry Gutov
2024-07-01 21:24               ` Alan Mackenzie
2024-07-01 22:07                 ` Daniel Colascione
2024-07-02  1:00                   ` Po Lu
2024-07-02  3:26                     ` C-o (was: Proposal: new default bindings for winner and windmove) Stefan Monnier
2024-07-02 22:31                       ` Stefan Kangas
2024-07-03 10:07                       ` Per Starbäck

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).