GNU bug report logs - #64185
proposal for new function: copy-line

Previous Next

Package: emacs;

Reported by: Zachary Kanfer <zkanfer <at> gmail.com>

Date: Tue, 20 Jun 2023 05:09:02 UTC

Severity: wishlist

Full log


Message #101 received at 64185 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
Cc: 64185 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, me <at> eshelyaron.com,
 zkanfer <at> gmail.com
Subject: Re: bug#64185: proposal for new function: copy-line
Date: Mon, 26 Jun 2023 20:37:10 +0300
>> I don't see from where we can get such assumption - e.g. extending
>> the region to the copied text also makes sense.
>
> No, it's actually a firm requirement.  Extending the region would only
> allow making exponentially more copies which is useless in practice.
> Try it yourself and you'll see.

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.

>> When the users will request a setting for columns, then we could
>> add a new option e.g. `duplicate-dwim-final-column`.
>
> Request submitted then!

`duplicate-dwim-final-column` should be applied to both cases?
To rectangular regions and to lines?  In case of lines it could
define whether to keep the original column, or move to the
beginning of the line, or to the end of the line?

>> And if the users need to do the same with regions, then a separate
>> option could be added e.g. `duplicate-dwim-final-region`.
>
> How about we, for a change, attempt this thing called design, instead
> of the customary Emacs piecemeal hodgepodge?

Then I think `duplicate-dwim` is a misnomer, and it was misdesigned.
A proper name that matches the design of `thing-at-point`, would be
`duplicate-thing`.  thingatpt.el contains the definition of the region
among many other things that are candidates for duplication.

Since the design of a general thing-duplication command
is still under development, maybe it would be appropriate
to remove `duplicate-dwim` from emacs-29, and continue
its development in master?




This bug report was last modified 1 year and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.