bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46621: Copy line


From: Mattias Engdegård
Subject: bug#46621: Copy line
Date: Thu, 23 Jun 2022 17:10:22 +0200

22 juni 2022 kl. 09.54 skrev Lars Ingebrigtsen <larsi@gnus.org>:

> It was also suggested to leave point at the start of the duplicated
> lines.  I think that makes more sense -- the use case here is to copy
> lines so that you can start altering them, after all.

We need experience of how it feels in practice. That is, bind the command to a 
convenient key in your init.el and try remember to use it while editing. Note 
where it works as desired and where not.

Some of what I found:

* Having the cursor remain in the same column is very useful as it's usually 
near the spot to be edited in the original or copied line. Automatically moving 
it to the beginning or end of the line would make it worse.

* Whether it is better to keep the cursor on the first line (as if duplicating 
downwards) or the last line (as if duplicating upwards) is less clear. It 
basically comes down to whether it is more common to want a similar but 
different line above or below the original line. I weakly favour the current 
design because it generalises better and it's slightly more convenient to edit 
a sequence of lines top-down than bottom-up.

* A single-key binding (like H-y but not C-x y) makes quite a difference 
because that way I can quickly stutter out copies as needed without having to 
plan ahead and use prefix arguments.

* Rectangle duplication is very useful when editing tables or code with similar 
structure. Compared to copy-paste, it saves a lot of cursor movement and 
permits immediate repetition if more than one copy is required.

I would be very interested in your own experience (much more than anyone's 
theoretical speculation).

> The benefit of adding the region sensitive behaviour seems even
> slighter, and the problem is, as I said, that it subverts the
> (currently) clear semantics the new command has.

It's not an unnatural combination; several other editors have similar commands.

Moreover, even if you don't find the region-sensitive behaviour, others do -- 
for rectangular regions in particular. Nobody is going to complain that there 
are functions in Emacs that they don't care to use, especially when they don't 
take up extra keybindings.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]