unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mattiase@acm.org, 56418@debbugs.gnu.org
Subject: bug#56418: Add duplicate-dwim [PATCH]
Date: Thu, 04 Aug 2022 00:01:25 -0400	[thread overview]
Message-ID: <E1oJS33-0004Vi-7D@fencepost.gnu.org> (raw)
In-Reply-To: <83a68s8n3d.fsf@gnu.org> (message from Eli Zaretskii on Fri, 29 Jul 2022 09:11:34 +0300)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I've seen no cogent argument against making `duplicate-line' operate
on the region when that is active.  Someone presented this argument,

    Simen proposed something quite similar (added to the CCs), and my only
    objection was that the semantics of the simpler command is quite
    clear -- it always creates a new line, even if we're at a final line in
    a buffer without a newline.  When dealing with regions, it's not quite
    clear what the semantics should be in those corner cases (i.e., regions
    that doesn't end with a newline)...

but "duplicate the region" is totally clear, if interpreted strictly:

    Not much of a edge case, is it? If you select "bon" and duplicate you =
    end up with "bonbon", as promised.

The practical question is, which way will people find more convenient
to use?

Making `duplicate-line' region-sensitive would enable people to do both
operations with one key binding.  That is clearly a plus.  Good key
bindings are scarce and they take up space in the mind.

Making `duplicate-line' region-sensitive could lead to surprises when
the region is active, for a user who only ever uses it to duplicate
lines.  That is clearly a minus -- but how big is it in practice?

If we can only spare one binding for this, which behavior should that
binding have?

I suggest we define `duplicate-lines' with an option to control
whether it is region-sensitive, so that people can try it both ways
and tell us which way they like better.  Then we could set the
default for that option accordingly.


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







  reply	other threads:[~2022-08-04  4:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  8:29 bug#56418: Add duplicate-dwim [PATCH] Mattias Engdegård
2022-07-08 10:05 ` Mattias Engdegård
2022-07-26 12:26   ` Mattias Engdegård
2022-07-26 12:46     ` Stefan Kangas
2022-07-26 12:56       ` Robert Pluim
2022-07-27  9:01         ` Mattias Engdegård
2022-07-29  3:54           ` Richard Stallman
2022-07-29  6:11             ` Eli Zaretskii
2022-08-04  4:01               ` Richard Stallman [this message]
2022-08-04 18:43                 ` Mattias Engdegård
2022-08-16 11:08                   ` Robert Pluim
2022-07-31  8:36             ` Mattias Engdegård
2022-08-01  3:33               ` Richard Stallman
2022-08-01 11:29                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1oJS33-0004Vi-7D@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=56418@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).