[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46621: Copy line
From: |
Lars Ingebrigtsen |
Subject: |
bug#46621: Copy line |
Date: |
Sat, 18 Jun 2022 14:56:14 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Simen Heggestøyl <simenheg@runbox.com> writes:
>> I've now added this command to Emacs 29 as `duplicate-line'.
>
> Cool! I've had a similar command defined locally since 2015 (which I've
> found so useful over time that I've given it a short global keybinding).
>
> I have some suggestions that I think make the command even more useful:
>
> - Making it more DWIM'y by having it duplicate the region instead when
> it's active (perhaps giving it a more general name like
> `duplicate-thing`, `duplicate-dwim`, or maybe just `duplicate`).
That makes sense, but there are some edge conditions here that the
current implementation avoids by using a "line" definition. That is, if
we're at the final line in the buffer, and there's no newline at the
end, `duplicate-line' will add one. That is, it's really line oriented,
and not region oriented, and making it do regions, too, would possibly
make it more confusing.
Unless we ensure a newline at the end of all the regions we paste in.
> - Having point end up at the duplicated line instead of the original
> one, since that's the line you usually want to edit (in my
> experience).
Yes, that's true.
> - With a prefix argument, comment out the original line/region after
> duplicating it. This is perhaps a bit too specialized to be useful in
> general compared to the other two suggestions, though I've found it
> very useful personally.
I think that sounds a bit too specialised.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#46621: Copy line, Lars Ingebrigtsen, 2022/06/17
- bug#46621: Copy line, Mattias Engdegård, 2022/06/18
- 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