From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#69097: [PATCH] Add 'kill-region-or-word' command Date: Sun, 05 May 2024 19:59:46 +0300 Organization: LINKOV.NET Message-ID: <86jzk8i48t.fsf@mail.linkov.net> 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> <86zft4jl5d.fsf@mail.linkov.net> <87plu05hcu.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9785"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 05 19:00:48 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 1s3fEG-0002M4-AC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 May 2024 19:00:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3fE9-00073Q-HS; Sun, 05 May 2024 13:00:41 -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 1s3fE7-00072l-5v for bug-gnu-emacs@gnu.org; Sun, 05 May 2024 13:00: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 1s3fE6-0008Nv-EH for bug-gnu-emacs@gnu.org; Sun, 05 May 2024 13:00:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s3fET-0001nF-Oe for bug-gnu-emacs@gnu.org; Sun, 05 May 2024 13:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 May 2024 17:01:01 +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.17149284576876 (code B ref 69097); Sun, 05 May 2024 17:01:01 +0000 Original-Received: (at 69097) by debbugs.gnu.org; 5 May 2024 17:00:57 +0000 Original-Received: from localhost ([127.0.0.1]:60708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fEL-0001mq-3z for submit@debbugs.gnu.org; Sun, 05 May 2024 13:00:56 -0400 Original-Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:43643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fEF-0001mk-2F for 69097@debbugs.gnu.org; Sun, 05 May 2024 13:00:51 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 5B5B5FF806; Sun, 5 May 2024 17:00:15 +0000 (UTC) In-Reply-To: <87plu05hcu.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 05 May 2024 16:54:57 +0000") X-GND-Sasl: juri@linkov.net 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:284521 Archived-At: >>>> > +(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?). >> >> So this is for Readline compatibility: >> >> unix-word-rubout (C-w) >> Kill the word behind point, using white space as a word boundary. >> The killed text is saved on the kill-ring. >> >> Then I have no opinion, since 'backward-kill-word' (C-, M-DEL). >> already does this just fine. > > Right, the initial command just merges `backward-kill-word' and > `kill-region' into one. There are two ways to merge: 1. `backward-kill-word' into `kill-region' 2. `kill-region' into `backward-kill-word' I don't know why prefer one over another.