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

From: Juri Linkov <[email-masked]>
Date: Tue, 27 Jun 2023 21:28:10 +0300

>> 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.