[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?
duplicate-line-or-region.diff
Description: Binary data
- bug#46621: Copy line, Lars Ingebrigtsen, 2022/06/17
- bug#46621: Copy line,
Mattias Engdegård <=
- bug#46621: Copy line, Eli Zaretskii, 2022/06/18
- bug#46621: Copy line, Lars Ingebrigtsen, 2022/06/19
- bug#46621: Copy line, Mattias Engdegård, 2022/06/19
- bug#46621: Copy line, Lars Ingebrigtsen, 2022/06/19
- bug#46621: Copy line, Mattias Engdegård, 2022/06/20
- bug#46621: Copy line, Lars Ingebrigtsen, 2022/06/21
- bug#46621: Copy line, Mattias Engdegård, 2022/06/21
- bug#46621: Copy line, Lars Ingebrigtsen, 2022/06/22
- bug#46621: Copy line, Juri Linkov, 2022/06/21