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

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

bug#64185: proposal for new function: copy-line


From: Juri Linkov
Subject: bug#64185: proposal for new function: copy-line
Date: Tue, 27 Jun 2023 21:28:10 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> I remember already the need of doing this several times: to create
>> initial content for testing first I select one line then duplicate
>> its region, then select the whole buffer and duplicate it again
>> and so on, so the duplicated region grows exponentially.
>
> Yes, but there is no reason to do that now.  Just use duplicate-dwim
> (or duplicate-line).  Both benefit a lot from immediate repeatability.

I agree it's much easier to do this with the new commands now.
(The only consideration is performance, but probably not worth
making the code more complex by increasing the size of copied region
exponentially to avoid inserting a large amount of small chunks one by one.)

> I don't like the 'dwim' name part either but it has some precedence.
> A single function should suffice but since this is Emacs, we have two
> of them for historical reasons before anything is even released.

I see no problem in having two commands, since most users expect a standard
command to duplicate lines, and a more general dwim command is a bonus
for more advanced uses.  So AFAIC, a separate option for duplicate-line
is a must, and an option for duplicate-dwim is a nice-to-have.





reply via email to

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