From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69097: [PATCH] Add 'kill-region-or-word' command Date: Mon, 06 May 2024 17:46:20 +0100 Message-ID: <87edaeevmr.fsf@zephyr.silentflame.com> References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.fsf@posteo.net> <861q6jji0i.fsf@gnu.org> <87o79n6uj6.fsf@posteo.net> <86v83vi2kr.fsf@gnu.org> <86seyzi2by.fsf@gnu.org> <87cyq26bt8.fsf@posteo.net> <864jbeixkt.fsf@gnu.org> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> Reply-To: Sean Whitton Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37947"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: Eli Zaretskii , Juri Linkov , philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 06 18:47:51 2024 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 1s41VG-0009fd-U0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 May 2024 18:47:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s41V6-0003pH-RC; Mon, 06 May 2024 12:47:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s41V5-0003oL-Mv for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 12:47:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s41V5-0008ID-DM for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 12:47:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s41VS-0006sE-Dn for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 12:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 May 2024 16:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69097 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69097-submit@debbugs.gnu.org id=B69097.171501402226409 (code B ref 69097); Mon, 06 May 2024 16:48:02 +0000 Original-Received: (at 69097) by debbugs.gnu.org; 6 May 2024 16:47:02 +0000 Original-Received: from localhost ([127.0.0.1]:39024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s41US-0006re-SF for submit@debbugs.gnu.org; Mon, 06 May 2024 12:47:02 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:54792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s41UJ-0006rT-TV for 69097@debbugs.gnu.org; Mon, 06 May 2024 12:46:59 -0400 DKIM-Signature: a=rsa-sha256; b=K7+zr2RXXvFp0oSMFMHZXAjjxmxJQ9RtzLKvFPcxBL+lhQu7Hv7K3+ERsvYe4qJ/oagooHm7+sGT2UMy77R6TETZ9V0MVSPK2TofF87hIq96z8kNsIGuPFxIq3XmH5msvxF1Jetr0Z5SNwOaOEIdPehIix/aAtMYhU3hsZPXxOVWVu/dJHB+O+Axy+sqvQPsoHNyRPzG1M6zcLv2Wvzzo90lTIKhQuzDuElc6qVLUJ3k9ewx4S7TeyB/40/V7lDXRjDU7/6iKKpHe43xrWkv1YrHWHApU7ugKRaMxkpe9XC7er7YmEIhbZwlTdbJUSIJDjcWV3dPkhNsej+VqbUH4g==; s=purelymail2; d=spwhitton.name; v=1; bh=HLUgBBPHceRuaWMKGQZFfcvvCSyIURgXC+uRjjSgn4E=; h=Received:Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=Itjy0Et8AKHbAd295ofCBupm5Jy0IZkCno/GUZxpwTsmmzI940UmFUnGQRgeqCZxMZY/MnuZF1XliURcEYWJcYqmcIi+Uod2KGcn9oHosorBOIMTRt5kf5mP7zuBMk6K0qqIsbDwlusI1KH/H1qw28kcV+z8CARwUowatgsreKrUyUo8y4PJc0hyOvXO7PAsEBKvbIFDuTC2b6cuwsT3sU2m00RCb4opkhg6EC5CXKsSwmYh4UV5scPopnmwMub/bMYrSZaq8rc/n+5uSW7qd18ZU6HTMiSUOiRRk0vkIPqbIptrAjsjpEqY23Wd6VgUAFeAnCJ9MpuP/EiA9nXyPw==; s=purelymail2; d=purelymail.com; v=1; bh=HLUgBBPHceRuaWMKGQZFfcvvCSyIURgXC+uRjjSgn4E=; h=Feedback-ID:Received:Received:From:To:Subject; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 868498774; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 06 May 2024 16:46:21 +0000 (UTC) Original-Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 4D620947D9B; Mon, 6 May 2024 17:46:20 +0100 (BST) In-Reply-To: <86h6fceij2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 May 2024 12:04:49 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284588 Archived-At: Hello, On Sun 05 May 2024 at 12:04pm +03, Eli Zaretskii wrote: >> From: Juri Linkov >> Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org >> Date: Sun, 05 May 2024 09:53:19 +0300 >> >> > +(defcustom kill-word-if-no-region nil >> > + "Non-nil means that `kill-region' without a region will kill the last word." >> > + :type 'boolean >> > + :group 'killing) >> >> What a strange thing. `kill-region' is not related to word commands >> in no way. Why not kill a sentence? Why not kill a line? Why just word? >> All existing commands handle an active region. But there is no commands >> that do in the opposite direction where a general command handles >> one random specific case. This is because the region is a more >> general concept. > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69097#14 is supposed to > provide the rationale (consistency with what C-w does in a terminal, > which I presume means in Bash or similar programs which use > Readline?). I am concerned that the difference between Emacs's backward-kill-word and the tty unix-word-rubout is not being taken into account with this change proposal. In bash on Linux there is actually both M-DEL and C-w, and they do different things, and it's useful to have both. E.g. if you have a half-entered command % foo bar/baz/quux with point at the end of the line, then M-DEL can be used to delete individual path components, e.g. M-DEL M-DEL will get you % foo bar/ which is nice if you need to correct some path components. But C-w always deletes back to whitespace, in this case leaving just 'foo', so you can replace the whole argument, or several arguments, with C-w, instead of having to type M-DEL lots of times. So if what we're aiming for here is concordance with the terminal, then the fallback behaviour should not be Emacs's backward-kill-word, but a new command that's more like unix-word-rubout. But then, I'm not sure introducing something that funadmental to Emacs's basic command set is appropriate in the context of thinking about fallback behaviour. (I have C-w in Emacs be like unix-word-rubout, keep M-DEL as the default, and move kill-region elsewhere.) -- Sean Whitton