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 #116 received at 64185 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
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: Tue, 27 Jun 2023 17:35:43 +0200
26 juni 2023 kl. 19.37 skrev Juri Linkov <juri <at> linkov.net>:

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

> `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?

No, I meant the same as you were proposing for lines: whether to insert copies before or after the original (or where point and the region should be afterwards, but that's pretty much the same thing as long as we preserve window-start, as you correctly pointed out).

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

That is a very different operation. `duplicate-dwim` acts on a buffer area designated by the user regardless of its content. The 'thing' functions (there seem to be no commands) parse buffer contents to derive a value or extent.

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.






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.