From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#56418: Add duplicate-dwim [PATCH] Date: Thu, 04 Aug 2022 00:01:25 -0400 Message-ID: References: <65479FAA-8062-4E44-92E4-B810C8C3CE57@acm.org> <87tu746nhg.fsf@gmail.com> <3B75963B-773A-4646-A414-0D46C2E4D61F@acm.org> <83a68s8n3d.fsf@gnu.org> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mattiase@acm.org, 56418@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 04 06:02:49 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJS4P-0004O4-Dv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 06:02:49 +0200 Original-Received: from localhost ([::1]:53822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJS4N-0000Dp-Qp for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 00:02:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJS3e-0000CA-7x for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 00:02:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJS3d-0007ge-Uo for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 00:02:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJS3d-0002Aa-OB for bug-gnu-emacs@gnu.org; Thu, 04 Aug 2022 00:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2022 04:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56418-submit@debbugs.gnu.org id=B56418.16595856958308 (code B ref 56418); Thu, 04 Aug 2022 04:02:01 +0000 Original-Received: (at 56418) by debbugs.gnu.org; 4 Aug 2022 04:01:35 +0000 Original-Received: from localhost ([127.0.0.1]:50711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJS3C-00029v-Ko for submit@debbugs.gnu.org; Thu, 04 Aug 2022 00:01:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJS3A-00029f-55 for 56418@debbugs.gnu.org; Thu, 04 Aug 2022 00:01:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJS34-0007bO-L0; Thu, 04 Aug 2022 00:01:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=iQHgjPYleLyMTMuNY+1cRaFHgF+R1QC3IvypPLzwTEI=; b=UJ7jkX5o724z 1by7S95MTQQjpwCur1zBMjRzcYRkSF/XTNPDjnUoLOhzGEem3iTDO083uLloO4qXcYwiw8QXGL32V 97/zAhIauWlEtPNXpDRJwKsQ6zXgNj8jDA46a83f/iVi9DRLRDhozk+KPtIGRVbK7CO4jTU+Sbjrv uY9E2wcgpUlqYZ1niHERcaK8QJ966TXvo2B9c/Xry+nXb8O+h3Gy13+58BG5PHCqUJ+mt++pyOzoW TMrhK4FH7yJoXp768MqKPyjeYTn7+sZo/+5YVe06NuSZLoGGR+ZH6heMkvYZwxdRHGBh9RJy3qrOo A/KtGvxyiUW4xZLaZCZNjA==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1oJS33-0004Vi-7D; Thu, 04 Aug 2022 00:01:25 -0400 In-Reply-To: <83a68s8n3d.fsf@gnu.org> (message from Eli Zaretskii on Fri, 29 Jul 2022 09:11:34 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238670 Archived-At: [[[ 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)