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: Sat, 18 Jun 2022 20:02:58 +0200

> I've now added this command to Emacs 29 as `duplicate-line'. 

Thank you! There was quite some discussion about generalising the concept last 
time it came up for discussion, and making it work on the region when active 
was found to be very useful. It comes quite naturally in use, much like 
upcase-dwim etc.

The attached patch does that. For extra convenience, when the active region is 
rectangular it is duplicated to the right, since that is what is usually most 
convenient.

There's a few subtleties here: the code takes care to preserve the region 
because the user may want to press the key again for another copy. (This means 
that we need to use undo-inhibit-region for undo to work properly.)

Do you feel audacious enough for a standard key binding?

Attachment: duplicate-line-or-region.diff
Description: Binary data


reply via email to

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