From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 13 04:56:23 2024 Received: (at submit) by debbugs.gnu.org; 13 Feb 2024 09:56:23 +0000 Received: from localhost ([127.0.0.1]:41655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZpWW-0004Fq-AL for submit@debbugs.gnu.org; Tue, 13 Feb 2024 04:56:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:49158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZpWR-0004FV-6L for submit@debbugs.gnu.org; Tue, 13 Feb 2024 04:56:19 -0500 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 1rZpW9-00011k-Hi for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 04:55:57 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZpVu-0002yL-Jx for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 04:55:57 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AB1BA240104 for ; Tue, 13 Feb 2024 10:55:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1707818140; bh=AGhS5fAlCwcWwOhEzjbDQ5xuFmfJZUCEcTzYryQO7Yc=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=mOiebyWuJ85kWAlRrae3f+KBZIOo4AXo/rQ+yrllPCMk41NiiGqTZXMIW3yUCv1eK FoGBzp3gASpwMAmDRr2uPk/UOalhhedhb00z9uvEhXGIiWM8zyGmxajvHEEE9Zkhe1 g9CeBU2U4d8u2RFoPHo2sZ6YKy1/oYIK8/by0Z/m9nqwo27N6N+Haa0CzfGDHLU4Tk SidGn0kwfoOilxz5UyHEYrrxj6bYHYNwN1xeT66Rm3lfcq6395Mx1/n7JqbEG2mJ/r 1f43U0Q+cFAIvQJfJSD9BiPWYFU10qF3gZzbCJbYa/NeSRoVv/I3e1uur24fgSnIob +7hg12V2iplqQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TYxXX2gzYz9rxR for ; Tue, 13 Feb 2024 10:55:40 +0100 (CET) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: [PATCH] Add 'kill-region-or-word' command OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Tue, 13 Feb 2024 09:55:39 +0000 Message-ID: <871q9g8z8k.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain This is another useful command I find myself re-implementing every time I use an unmodified Emacs, that I think would provide some nice convenience for people used to classical Unix keybindings. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-'kill-region-or-word'-command.patch Content-Description: [PATCH] Add 'kill-region-or-word' command >From b08b5cca09e1534b7ec28f516c891065eff80a9f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 13 Feb 2024 10:51:22 +0100 Subject: [PATCH] Add 'kill-region-or-word' command * lisp/simple.el (kill-region-or-word): Add it. * etc/NEWS: Document it. --- etc/NEWS | 6 ++++++ lisp/simple.el | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 6fae64728f2..e7e516d61a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -223,6 +223,12 @@ executable, if it exists. This should remove the need to change its value when installing GNU coreutils using something like ports or Homebrew. +--- +** New command 'kill-region-or-word'. +This command will kill a region, if it is active, or delete the last +word. As such, it is a convenient alternative binding for C-w, +providing a DWIM behaviour for both Emacs and Unix users. + +++ ** cl-print diff --git a/lisp/simple.el b/lisp/simple.el index 9a33049f4ca..bf4080fcf2d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8798,6 +8798,15 @@ backward-kill-word (interactive "p") (kill-word (- arg))) +(defun kill-region-or-word () + "Call `kill-region' if there is an active region. +Otherwise kill the last word, just like Unix." + (interactive) + (call-interactively + (if (use-region-p) + #'kill-region + #'backward-kill-word))) + (defun current-word (&optional strict really-word) "Return the word at or near point, as a string. The return value includes no text properties. -- 2.43.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 03:37:34 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 07:37:34 +0000 Received: from localhost ([127.0.0.1]:46220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2nU6-0003Kr-1V for submit@debbugs.gnu.org; Fri, 03 May 2024 03:37:34 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2nU4-0003Kj-HR for 69097@debbugs.gnu.org; Fri, 03 May 2024 03:37:33 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0C6B9240103 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 09:37:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714721824; bh=1K+pmI9QlCxv7tynatJP6MppAEQbfmx3+otVKsHax8U=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=n675jBikEmPCcibERT5qHWXmDXx3stuAfz8sCmv7SrBteXdcV2sLb5iWqYACiKNAn 31Jk5eSElFk6kjC1zjRHy9nm03XE49vqEcYVtZcX8bTxgEmbXiPMKw1MAX7Vh5Co1D FhfcKNvrASkT2xTrvcd/BS8x/KX30TnbyCI1onT66BxpGarOjgn2BTCZ8H4gxMZo1Y 2XXPPBL4SKo1RzjgyNQgYgogFvwDbrLIm49vJKcdlwYvGy3XJQ73r64XE7f6LZrmJF B9QiUOFzxfZQkgDgCcuRKPULfXqnpQXTZo/VJBnXv/yVi3AY9+hrhQMio5f3CWSRKs jlpIjBqaldkFg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VW2gg3G7nz6tyG for <69097@debbugs.gnu.org>; Fri, 3 May 2024 09:37:03 +0200 (CEST) From: Philip Kaludercic To: 69097@debbugs.gnu.org Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <871q9g8z8k.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 13 Feb 2024 09:55:39 +0000") References: <871q9g8z8k.fsf@posteo.net> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 03 May 2024 07:37:03 +0000 Message-ID: <87wmob73ds.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > This is another useful command I find myself re-implementing every time > I use an unmodified Emacs, that I think would provide some nice > convenience for people used to classical Unix keybindings. ping? I had a discussion with RMS off-list and he seemed to be supportive of the change. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 06:41:07 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 10:41:07 +0000 Received: from localhost ([127.0.0.1]:46370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qLj-00020V-B4 for submit@debbugs.gnu.org; Fri, 03 May 2024 06:41:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qLf-000201-MR for 69097@debbugs.gnu.org; Fri, 03 May 2024 06:41:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2qLB-0000dz-9U; Fri, 03 May 2024 06:40:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=51Ex3LLhcFJZ1Tgq48N3F/CNy4Ecj/r2UHphGwLBwbQ=; b=QmOEPqZTubj0 WVv+DSl7CHEMS/q2/NXNGbgXUUkm2cpLXZjtSqioRnEDZRDnp6namcQgE9kdzVMwX4nOamn1cK762 zrHoGvLihf9hc8qlJYDEIcNW50FCXUslIN0ONBKBYaE85bgAOX6KJ8u+akHwHDgqZeagPEz4Wvpib vlPSH7UW1tXhFYGB+TfFvd9+59mGr7K0tpn5ih0UmVo7wehgyXOeHGWxstaUkrLIMwC7yeR5ug7DW 1D8DDKphjeS3DRKIXEwyU12i+99ty8E0V1tan6P3wbLPIuEzT5BB/6dQ7BQtpHm08yWUgFPwhQYQz ZGdnyBANgJ/6wrb4GUCC3Q==; Date: Fri, 03 May 2024 13:40:13 +0300 Message-Id: <861q6jji0i.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87wmob73ds.fsf@posteo.net> (message from Philip Kaludercic on Fri, 03 May 2024 07:37:03 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: Richard Stallman , 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Date: Fri, 03 May 2024 07:37:03 +0000 > > Philip Kaludercic writes: > > > This is another useful command I find myself re-implementing every time > > I use an unmodified Emacs, that I think would provide some nice > > convenience for people used to classical Unix keybindings. > > ping? I had a discussion with RMS off-list and he seemed to be > supportive of the change. That's a problem with off-list discussions: no one knows about them. More to the point, can you explain why we need this, given the existence of kill-word? Also, this kills backward, something that is not evident, neither from the name of the command nor from the doc string (and the obscure reference to Unix doesn't help, IMO). Finally, having another command that kills the region doesn't seem justified, or is it? From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 06:48:48 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 10:48:49 +0000 Received: from localhost ([127.0.0.1]:46375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qTA-00023v-E3 for submit@debbugs.gnu.org; Fri, 03 May 2024 06:48:48 -0400 Received: from mout01.posteo.de ([185.67.36.65]:34203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qT6-00023p-03 for 69097@debbugs.gnu.org; Fri, 03 May 2024 06:48:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BADE0240027 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 12:48:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714733295; bh=KEV6wCEZEc69wUKn1/eVxvpf7wMpd+AQLmZ2LcFFUgs=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=aG2IIyvjkUVCi9/atotFZvvCL8BmJ3e0zondiE0mLub4/bG1dwcswcEsL3HS1H9eA MkxXuH683zHM9jyyjBa53019uglLoc53DywtcTpaiE/nRV23SCj6TFEnGrbhfXtSSJ bXIZ1JQrpM/oLH/DgxgFPhK4WN9xZpgO1tpQtiqCrczNkeQs1DIEobMVluIaO+7Xv8 96mCdsYWFm2Str6yq2EeErHX2bSGPh9GUkNZjGaIG9RztxuzXcGjlADhIbshl44MV3 AbCRVTQxTwl+HXP5QFx89Az3VkMw5DBUyp/zyNL2dVIVOTdZ9tpO0u7ft4Vc3qlM36 YEHN2HIIz7dgg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VW6wG329nz9rxF; Fri, 3 May 2024 12:48:14 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <861q6jji0i.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 May 2024 13:40:13 +0300") References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.fsf@posteo.net> <861q6jji0i.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 03 May 2024 10:48:13 +0000 Message-ID: <87o79n6uj6.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: Richard Stallman , 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Date: Fri, 03 May 2024 07:37:03 +0000 >> >> Philip Kaludercic writes: >> >> > This is another useful command I find myself re-implementing every time >> > I use an unmodified Emacs, that I think would provide some nice >> > convenience for people used to classical Unix keybindings. >> >> ping? I had a discussion with RMS off-list and he seemed to be >> supportive of the change. > > That's a problem with off-list discussions: no one knows about them. I also realised this too late, if you want to I can resend the messages. > More to the point, can you explain why we need this, given the > existence of kill-word? > > Also, this kills backward, something that is not evident, neither from > the name of the command nor from the doc string (and the obscure > reference to Unix doesn't help, IMO). > > Finally, having another command that kills the region doesn't seem > justified, or is it? The motivation is sort of the same as with generalising `upcase-word' to `upcase-dwim'. If there is no active region, it behaves like `backward-kill-word' (which is what C-w does in a terminal as well), but if there is an active region it reverts to `kill-ring-save'. I have this in my personal configuration for ages, and it is always one of the first things I re-implement when using an Emacs without a custom init.el. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 07:00:03 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 11:00:03 +0000 Received: from localhost ([127.0.0.1]:46382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qe1-0002A2-S2 for submit@debbugs.gnu.org; Fri, 03 May 2024 07:00:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qdx-00029R-0g for 69097@debbugs.gnu.org; Fri, 03 May 2024 07:00:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2qdU-0004gq-Ke; Fri, 03 May 2024 06:59:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Gx6K8l5MXoGOVurtCOdDug37haKsyYQmZjJzRGOrdns=; b=gCDb1UrXs/gm fAr2eJqfsUxAho5nwkssQZHENHpB9g2qoKN06K29xZJ5k8u1oYZBFG+yAf3eS3PrJxBlEiQrmu0Zc cWR6xngm2BMhnfBQ29j7uVDP7ka2sN6XeFx9UzGeW2zcNHyh35VJNpiDAIOpE60iGJkJFxgzBk1dB 5mu9jQBjzGffy3EKRnWlYbUpfZVryiXvdFReEetRN5g2sjj9NS4egx0YcwHPeY/3EzP7tFo+UZUMJ gkIfZ/bUjrGcaWwHKEQOkYOVEoP2kGjsHNVwo5Z1oXOyYzDnfeNxZdBcMT1l2WVa+3i7EVjkV0cEA 9Ki+LQQK/m5wQqoIBXCB4A==; Date: Fri, 03 May 2024 13:59:00 +0300 Message-Id: <86v83vi2kr.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87o79n6uj6.fsf@posteo.net> (message from Philip Kaludercic on Fri, 03 May 2024 10:48:13 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.fsf@posteo.net> <861q6jji0i.fsf@gnu.org> <87o79n6uj6.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: 69097@debbugs.gnu.org, Richard Stallman > Date: Fri, 03 May 2024 10:48:13 +0000 > > Eli Zaretskii writes: > > >> ping? I had a discussion with RMS off-list and he seemed to be > >> supportive of the change. > > > > That's a problem with off-list discussions: no one knows about them. > > I also realised this too late, if you want to I can resend the messages. I think that would be a good idea, at least for posterity. So please do. > > More to the point, can you explain why we need this, given the > > existence of kill-word? > > > > Also, this kills backward, something that is not evident, neither from > > the name of the command nor from the doc string (and the obscure > > reference to Unix doesn't help, IMO). > > > > Finally, having another command that kills the region doesn't seem > > justified, or is it? > > The motivation is sort of the same as with generalising `upcase-word' to > `upcase-dwim'. If there is no active region, it behaves like > `backward-kill-word' (which is what C-w does in a terminal as well), but > if there is an active region it reverts to `kill-ring-save'. If so, then (assuming we decide to accept this change), the name of the command should be something like kill-word-dwim, and the doc string should mention the two commands you refer to above. > I have this in my personal configuration for ages, and it is always > one of the first things I re-implement when using an Emacs without a > custom init.el. Any reason why you need this command and cannot settle for the two commands it replaces heuristically? Are you using Emacs with transient-mark-mode on or off? From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 07:05:03 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 11:05:03 +0000 Received: from localhost ([127.0.0.1]:46387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qit-0002Ek-6p for submit@debbugs.gnu.org; Fri, 03 May 2024 07:05:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2qir-0002EI-Js for 69097@debbugs.gnu.org; Fri, 03 May 2024 07:05:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2qiP-000692-QM; Fri, 03 May 2024 07:04:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rFyPH/SIFaJEXmtCpwz0Y1V1DsT0MYiqYk9cwxDH2rw=; b=Cm4P6Ng9ifvQ aLBZtW5V2dX05oUef7G0kd9bYGzSRTQYhrJGcTp7vf5UGTSZbrSIK+NnrLULkEgtM4qzc7UVDFGPG fwH2Q9ernD6zlHeHgFiVSj6Kbs+lg5IE4H9M4Ebk0meWvwCJwIlZUe/Rt+u/v921UreMk0xduqOIm vIu0c7bbWEKt/Opradf8fS4OpettXimMpNHIAMMKnoXrDIlAEgU8IztX4oQcB50i4+vdtI5hxuHDA nvIuqLW1TpNMad+pWQ4L8UHjrILaGycAwVVua6Jby4HGMG3S6cQ1342MsO/Hkd2eqk5FR2QORNNAJ lml3d4K/D4o+c2a/mi1Evg==; Date: Fri, 03 May 2024 14:04:17 +0300 Message-Id: <86seyzi2by.fsf@gnu.org> From: Eli Zaretskii To: philipk@posteo.net In-Reply-To: <86v83vi2kr.fsf@gnu.org> (message from Eli Zaretskii on Fri, 03 May 2024 13:59:00 +0300) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.fsf@posteo.net> <861q6jji0i.fsf@gnu.org> <87o79n6uj6.fsf@posteo.net> <86v83vi2kr.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: rms@gnu.org, 69097@debbugs.gnu.org > Date: Fri, 03 May 2024 13:59:00 +0300 > From: Eli Zaretskii > > > From: Philip Kaludercic > > Cc: 69097@debbugs.gnu.org, Richard Stallman > > Date: Fri, 03 May 2024 10:48:13 +0000 > > > > > More to the point, can you explain why we need this, given the > > > existence of kill-word? > > > > > > Also, this kills backward, something that is not evident, neither from > > > the name of the command nor from the doc string (and the obscure > > > reference to Unix doesn't help, IMO). > > > > > > Finally, having another command that kills the region doesn't seem > > > justified, or is it? > > > > The motivation is sort of the same as with generalising `upcase-word' to > > `upcase-dwim'. If there is no active region, it behaves like > > `backward-kill-word' (which is what C-w does in a terminal as well), but > > if there is an active region it reverts to `kill-ring-save'. > > If so, then (assuming we decide to accept this change), the name of > the command should be something like kill-word-dwim, and the doc > string should mention the two commands you refer to above. > > > I have this in my personal configuration for ages, and it is always > > one of the first things I re-implement when using an Emacs without a > > custom init.el. > > Any reason why you need this command and cannot settle for the two > commands it replaces heuristically? Are you using Emacs with > transient-mark-mode on or off? And one more question: currently C-w signals an error if there's no region. So another idea is to extend C-w to delete the word at point if there's no region (where "no region" means "no active region" if transient-mark-mode is ON, otherwise it means "no mark set"). From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 12:15:52 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 16:15:52 +0000 Received: from localhost ([127.0.0.1]:47076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZf-0003F3-Pl for submit@debbugs.gnu.org; Fri, 03 May 2024 12:15:52 -0400 Received: from mout01.posteo.de ([185.67.36.141]:55277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZb-0003EO-LS for 69097@debbugs.gnu.org; Fri, 03 May 2024 12:15:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DFB5F240027 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:18 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWG9f2q1Tz9rxG for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:18 +0200 (CEST) Resent-To: 69097@debbugs.gnu.org Resent-From: Philip Kaludercic Resent-Date: Fri, 03 May 2024 18:15:17 +0200 Resent-Message-ID: <87bk5m7tyi.fsf@posteo.net> Received: from proxy02.posteo.name ([127.0.0.1]) by dovecot15.posteo.name (Dovecot) with LMTP id /ZC7I94J2GVQGgMAB3Nl4w for ; Fri, 23 Feb 2024 04:04:28 +0100 Received: from proxy02.posteo.de ([127.0.0.1]) by proxy02.posteo.name (Dovecot) with LMTP id lQBIF7YI2GVU9QAAGFAyLg ; Fri, 23 Feb 2024 04:04:28 +0100 Received: from mailin03.posteo.de (unknown [10.0.0.63]) by proxy02.posteo.de (Postfix) with ESMTPS id 4TgvxS1l1Lz11XQ for ; Fri, 23 Feb 2024 04:04:28 +0100 (CET) Received: from mx03.posteo.de (mailin03.posteo.de [127.0.0.1]) by mailin03.posteo.de (Postfix) with ESMTPS id 2D8F3218CE for ; Fri, 23 Feb 2024 04:04:28 +0100 (CET) X-Posteo-Spam-Status: v=1; e=base64; a=aes-256-gcm; d=6b/NguHiEeBBnK+kf0H+VuobUNLsCzvt3RcT4IaiGEROyrUJtf/SAoo19N5kLLhGxSJY7hs1A 3ded1JbGkyh/l27ynLFOtim9HtNijLbw6OzldhCLfQ4c/m06a/EuTu0S21M9vfxtEiLoqxdAi/l DGhfNu6puBiwbQ4Ua8q4/+xfGvR7Yzcm6PbTYlVIz2Q7f9LuaELkpFWfwpl2zYNhnehU2SLcP5P aHjFMP+TKY1GSdWV17A/Q+OkUXnTKGhh9KCATtleC/lYKAxd3d6FDojdxyLxnKJ408+egLv6JfP WDEWGjxMp4S/PM6ByksHMOXB5xkNfihkf72EcO82Lr1FdfeXDP Authentication-Results: posteo.de; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: posteo.de; spf=pass smtp.mailfrom=gnu.org X-Posteo-Antispam-Signature: v=1; e=base64; a=aes-256-gcm; d=UX1Mu6qlXc6Cwk244ve0WMyfqekIY5MLJuStOUvSOGuR531GuOLw4rwRdeiTmeN97eBhF65NLu98VBnyB9T+P7aOULJ+DgB0//3wj82ixaOJkm2PyojzRigHvetZHY3Si8IvrR94 Authentication-Results: posteo.de; dkim=pass (2048-bit key) header.d=gnu.org header.i=@gnu.org header.b=KVfHu46E; dkim-atps=neutral X-Posteo-TLS-Received-Status: TLSv1.2 Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mx03.posteo.de (Postfix) with ESMTPS id 4TgvxR4VTzz11nj for ; Fri, 23 Feb 2024 04:04:27 +0100 (CET) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdLrN-0000j2-Fz for philipk@posteo.net; Thu, 22 Feb 2024 22:04:25 -0500 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=xfvUDTCTcnGYSFXjjsGHaCID0rC7bs8g9BDU5qMEEHQ=; b=KVfHu46EeQd/ +Nfv0al4t3ZViphHt91s4DQnAP7oVn10oXcHmuGFxLftG2/BBY20q8pJ4hsRaWxKs9QdOmw5qaC+B 4GR4nZIxKy/BR+ojffg2O7oYJnJp2d6gkzvywTCwSiLs6g2ecUAMTovWh30QGtC0Q3KTtRacodayj fiYnW3HEIt10+mWAopbrEyys1PA6zUqwud/A01PNgYk7ctXQOj8P+UZ0lKILgCiAhIh+ZAe2/ESEY D6K2nwYBXE1E6WNUG4ch7ceuMWn7yhJ1MVehKZxMFLP8pktCFFeRTPYY2k+O37rbC3evxEZb3jCb1 NfdZC3lvw+yy21h9mdwziA==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rdLrN-0004wj-5E; Thu, 22 Feb 2024 22:04:25 -0500 From: Richard Stallman To: Philip Kaludercic In-Reply-To: <87sf1obkw9.fsf@posteo.net> (message from Philip Kaludercic on Mon, 19 Feb 2024 14:15:18 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87ttm7gi9i.fsf@posteo.net> <87sf1obkw9.fsf@posteo.net> Message-Id: Date: Fri, 23 Feb 2024 03:04:25 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) [[[ 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. ]]] > My command boils down to using `use-region-p'. This makes usage > together with `transient-mark-mode' intuitive, because if you can see > the selection, you kill a region, otherwise a word is deleted. That seems natural. Have you tried putting this on M-d? It could be convenient but it could instead be disturbing and surprising. -- 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) From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 12:15:55 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 16:15:55 +0000 Received: from localhost ([127.0.0.1]:47078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZi-0003FF-DG for submit@debbugs.gnu.org; Fri, 03 May 2024 12:15:54 -0400 Received: from mout01.posteo.de ([185.67.36.141]:52903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZb-0003EP-QH for 69097@debbugs.gnu.org; Fri, 03 May 2024 12:15:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C0441240027 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:19 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWG9g11fBz6tmv for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:19 +0200 (CEST) Resent-To: 69097@debbugs.gnu.org Resent-From: Philip Kaludercic Resent-Date: Fri, 03 May 2024 18:15:18 +0200 Resent-Message-ID: <877cga7tyh.fsf@posteo.net> Received: from proxy02.posteo.name ([127.0.0.1]) by dovecot15.posteo.name (Dovecot) with LMTP id I0ItJmqv2mU8hQIAB3Nl4w for ; Sun, 25 Feb 2024 04:16:03 +0100 Received: from proxy02.posteo.de ([127.0.0.1]) by proxy02.posteo.name (Dovecot) with LMTP id u2eWHNew2mWrmwMAGFAyLg ; Sun, 25 Feb 2024 04:16:03 +0100 Received: from mailin01.posteo.de (unknown [10.0.0.61]) by proxy02.posteo.de (Postfix) with ESMTPS id 4Tj85v2QS4z12MP for ; Sun, 25 Feb 2024 04:16:03 +0100 (CET) Received: from mx01.posteo.de (mailin01.posteo.de [127.0.0.1]) by mailin01.posteo.de (Postfix) with ESMTPS id 42BE820C82 for ; Sun, 25 Feb 2024 04:16:03 +0100 (CET) X-Posteo-Spam-Status: v=1; e=base64; a=aes-256-gcm; d=C5eZ6tWaGHY0rTTg4szTPyrCKXOhBfs2NbM9pe68w5DGhyzwVJIMXXwoEYgzpKvCXvQdogbut FD5OLNSc7BWYcqcNxrYLFT6s48lpkhER1mfSWQSwFvSPJBEryE/pyQobZCgYv+YbXATNGW3MEPk 0yHdxd+uEKjkymYCIhWsHINh+D9ZzUXJGWDM0vMnE/etzmW2i3ArQcpLs04DhivE30X2fSbghei Ptp1ItdyPpH0pVZ6BnpRy/1b+Fr4vBf+Wt6Q+9kh4EAAVu9dEDgNvCfVU3UcHshGe2tbRnRdfRJ RLAo26NFY+e5AyXAX1FvewX0xgU/6Dj+EMZtrda38yd12nz9Fw Authentication-Results: posteo.de; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: posteo.de; spf=pass smtp.mailfrom=gnu.org X-Posteo-Antispam-Signature: v=1; e=base64; a=aes-256-gcm; d=j05I4kpyA6JrpZXb61q7L1RS52koP0OsVVMVEFslQFJd+W9oKKAOMYM+056oTmEALkE4SzHFf5ZLb5SReyDCUVPlzags0eoPmAu5/7yuvcHyrQoh7H/7KeqnPyf3XABm8aHDZSTb Authentication-Results: posteo.de; dkim=pass (2048-bit key) header.d=gnu.org header.i=@gnu.org header.b=Sr5JLMpv; dkim-atps=neutral X-Posteo-TLS-Received-Status: TLSv1.2 Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mx01.posteo.de (Postfix) with ESMTPS id 4Tj85t5LXXz11Ff for ; Sun, 25 Feb 2024 04:16:02 +0100 (CET) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1re4zh-0002Wy-Qe for philipk@posteo.net; Sat, 24 Feb 2024 22:16:01 -0500 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=lPCZePF1D3BnKTk9j1Exk7ISwzFnYlcPn4X9okpczUE=; b=Sr5JLMpvaPDr BTYu1Hd1h1W5K4HKZt89BJjguhH51UoyGSGsf9hEqbtR8LQrXy1lN7W0ZcGFuEcAHqbQxUMGnKRQY qmw9X5U6yLD8Sa6e/JFSsIfjo0cmtpz2TGEZSRren2IxzyAEGRoQGkMiR6sbLbHGRWLMDm3xkvwi0 Evg0k7Yqh9+yQCRtPPPQoMNWKqu30qaN+OQvwGywUjaWRz6/UCIkZZFhe3uc5SB/RnGiGhGIZyNDu oSQBqCPAxjrkyhNv8cgQlpdzu6314KKmu2TtsCQjflwr6ueu8eU1YguybP5ry2cWWVq49OuOkE3SE f4s4KHm1OTcHdaE0V96UwQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1re4zh-0004Fi-5e; Sat, 24 Feb 2024 22:16:01 -0500 From: Richard Stallman To: Philip Kaludercic In-Reply-To: <871q93rzv8.fsf@posteo.net> (message from Philip Kaludercic on Fri, 23 Feb 2024 14:58:51 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87ttm7gi9i.fsf@posteo.net> <87sf1obkw9.fsf@posteo.net> <871q93rzv8.fsf@posteo.net> Message-Id: Date: Sun, 25 Feb 2024 03:16:01 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) [[[ 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. ]]] > > Have you tried putting this on M-d? It could be convenient but it > > could instead be disturbing and surprising. > I would expect it to be weird, as long as the proposed command uses > backward-kill-word, and not kill-word. I did not see in the email that it kills a word _backwards_. That being so, the natural binding for it would be M-DEL. Do people find this changed behavior for M-DEL natural? I am not presuming either yes or no. -- 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) From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 12:15:55 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 16:15:56 +0000 Received: from localhost ([127.0.0.1]:47080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZj-0003FH-1U for submit@debbugs.gnu.org; Fri, 03 May 2024 12:15:55 -0400 Received: from mout02.posteo.de ([185.67.36.142]:60395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZb-0003EN-CX for 69097@debbugs.gnu.org; Fri, 03 May 2024 12:15:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 49515240101 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:18 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWG9d3wJwz9rxG for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:17 +0200 (CEST) Resent-To: 69097@debbugs.gnu.org Resent-From: Philip Kaludercic Resent-Date: Fri, 03 May 2024 18:15:16 +0200 Resent-Message-ID: <87fruy7tyj.fsf@posteo.net> Received: from proxy02.posteo.name ([127.0.0.1]) by dovecot15.posteo.name (Dovecot) with LMTP id bbDgDzIt0GWQigIAB3Nl4w for ; Sat, 17 Feb 2024 04:53:09 +0100 Received: from proxy02.posteo.de ([127.0.0.1]) by proxy02.posteo.name (Dovecot) with LMTP id umkQGHos0GWqswEAGFAyLg ; Sat, 17 Feb 2024 04:53:09 +0100 Received: from mailin02.posteo.de (unknown [10.0.0.62]) by proxy02.posteo.de (Postfix) with ESMTPS id 4TcFJP0FwBz11rp for ; Sat, 17 Feb 2024 04:53:09 +0100 (CET) Received: from mx01.posteo.de (mailin02.posteo.de [127.0.0.1]) by mailin02.posteo.de (Postfix) with ESMTPS id EE73F2189D for ; Sat, 17 Feb 2024 04:53:08 +0100 (CET) X-Posteo-Spam-Status: v=1; e=base64; a=aes-256-gcm; d=4kPCdC2tk1UZNO9NIgGGqn9XYeTWn61GC4GRTu3CMecil4B13Qk6y/QivrNCJyBa/rtMMkqgP 1hrmpMplkfhjv4UkS343+bNdgR46JzEv2cIhb13WdiCAMFrlq9KUPhMRFAGKzx9OSPMBNdcg0jl A3uCzYc3IggjIsGT2Fs/aNgNH8pwicCNZLDmdgT1satNFTe8Zrpq6bSiNnz+1ZJtBYE4Ze4PDBj WMS7J6nPBUcZKOlZXzWvkLTmNZm++xp/MBfRE5jUyB4GgCswrKkZf+Oa8RLAT0mYqqu7Thak1hJ f2txdaaAr8nhdPJ7PNvOgFPiOx2FhK0OGsstpCfBGhWDS28XJV Authentication-Results: posteo.de; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: posteo.de; spf=pass smtp.mailfrom=gnu.org X-Posteo-Antispam-Signature: v=1; e=base64; a=aes-256-gcm; d=virFEvjKKJ0oE82INoUur2LUp6NF+Ycj6Ka8Z0vvTHogyfoz42dM2fLi7rnU75MXLn9eQdSS5LkZr/EMqlEb7Mkcw9diqMnk/jMb/GQ1rbLMTZwfIGLQFHn5fFdqgdEI8oB47vpK Authentication-Results: posteo.de; dkim=pass (2048-bit key) header.d=gnu.org header.i=@gnu.org header.b=NHiOyQbf; dkim-atps=neutral X-Posteo-TLS-Received-Status: TLSv1.2 Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mx01.posteo.de (Postfix) with ESMTPS id 4TcFJN27Tfz11l1 for ; Sat, 17 Feb 2024 04:53:08 +0100 (CET) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbBlC-0006xU-LD for philipk@posteo.net; Fri, 16 Feb 2024 22:53:06 -0500 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=//x1ae8BgLP+pGohdgilAhSGUo+fcZfCfwcJpIXnKX8=; b=NHiOyQbf92fn LxKnCXLDU0owtunvMK2QlL+oM+F1sY0Z32ISYq+la/aip/No5urrXuT468DH1D5h4OTPMctN6KrhJ 6Bz2av3+ljHd0so5Is9ZnFoVd5rZBvkHRNU4ig5tSeK/TDBqBW0kC+IxUJZsYre1rGmDhAuoRi7nf mXMj6PeEDYL8K1KiuLt+ao6gMWc6mwL+hVD3ze4PkzImNYTqWV62j5dFnNHhztzZ6sAakX+Sd4WoV DeARglSmDKWEg643YbLC/zdRLi0QXS+mwP0Wlyijzbpj9DOgR2tZWvvWvs4DiLEGSOct2kx74Ez3/ skKX7h92o/Aot0bxgaTKdQ==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rbBlC-0008Nk-8q; Fri, 16 Feb 2024 22:53:06 -0500 From: Richard Stallman To: Philip Kaludercic In-Reply-To: <871q9g8z8k.fsf@posteo.net> (message from Philip Kaludercic on Tue, 13 Feb 2024 09:55:39 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> Message-Id: Date: Sat, 17 Feb 2024 03:53:06 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) [[[ 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. ]]] > This is another useful command I find myself re-implementing every time > I use an unmodified Emacs, that I think would provide some nice > convenience for people used to classical Unix keybindings. Do you bind this to a key? If so, which key is convenient? -- 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) From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 12:15:56 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 16:15:56 +0000 Received: from localhost ([127.0.0.1]:47084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZk-0003FW-5q for submit@debbugs.gnu.org; Fri, 03 May 2024 12:15:56 -0400 Received: from mout01.posteo.de ([185.67.36.141]:59757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZc-0003EQ-EM for 69097@debbugs.gnu.org; Fri, 03 May 2024 12:15:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 30B01240027 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:20 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWG9g62szz6tmv for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:19 +0200 (CEST) Resent-To: 69097@debbugs.gnu.org Resent-From: Philip Kaludercic Resent-Date: Fri, 03 May 2024 18:15:19 +0200 Resent-Message-ID: <8734qy7tyg.fsf@posteo.net> Received: from proxy02.posteo.name ([127.0.0.1]) by dovecot15.posteo.name (Dovecot) with LMTP id 80L3CahR3WXnpwMAB3Nl4w for ; Tue, 27 Feb 2024 04:12:29 +0100 Received: from proxy02.posteo.de ([127.0.0.1]) by proxy02.posteo.name (Dovecot) with LMTP id HSFGFi0+3WXO/wAAGFAyLg ; Tue, 27 Feb 2024 04:12:29 +0100 Received: from mailin05.posteo.de (unknown [10.0.1.5]) by proxy02.posteo.de (Postfix) with ESMTPS id 4TkMws3J31zyZq for ; Tue, 27 Feb 2024 04:12:29 +0100 (CET) Received: from mx03.posteo.de (mailin05.posteo.de [127.0.0.1]) by mailin05.posteo.de (Postfix) with ESMTPS id 6363021812 for ; Tue, 27 Feb 2024 04:12:29 +0100 (CET) X-Posteo-Spam-Status: v=1; e=base64; a=aes-256-gcm; d=tMHeyCnbXBL0EjXDWh3UW21Yk7ZmI2se0c4L7gD1QsEB7h6obRoEa1ZbcibxBA41UGpVu+Nb4 /9RE7gWQAqs4Pf7WggZpo1OoaVLgA8Ul/jAjw4KJm7JozKvz2OYriyuKouDDi3CgTU8O7jzN0UK 75pe2HH5vSPLOtcFP/EOtKlhSKFutOeEkHOaOT1j8UOyvXDZl/3YMzlxumes8GnJ9Sq+B29jpIS QfF8gy9F30kJjx/9lRqquVs1VrUOfhu0BMsiq8lEBD4yc4exX2u3EmGPDqhYSshvx5ImnDR26Xe 0zRVTr6LCopkuSgblONa2ff2OUzY7yejvLzCiTz/u4T7bhZwqU Authentication-Results: posteo.de; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: posteo.de; spf=pass smtp.mailfrom=gnu.org X-Posteo-Antispam-Signature: v=1; e=base64; a=aes-256-gcm; d=GjKbawGenXcaae/B/iCGCN1hQy8fspOtFVOvYB6NlctN0vcTzW1BWgo4kNyZ0Zj9H/w/7bT1CrreMXv7o/iT3a5OQDLSZG8bffeLiZ2GWdcA2MLIJafZ5LiTSDEW8VmV79ltggZ7 Authentication-Results: posteo.de; dkim=pass (2048-bit key) header.d=gnu.org header.i=@gnu.org header.b=nUwY4LbU; dkim-atps=neutral X-Posteo-TLS-Received-Status: TLSv1.2 Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mx03.posteo.de (Postfix) with ESMTPS id 4TkMwr5TPBz11cG for ; Tue, 27 Feb 2024 04:12:28 +0100 (CET) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rentL-0001wA-OK for philipk@posteo.net; Mon, 26 Feb 2024 22:12:27 -0500 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=+JEPxao3WvNv+MK1mIdHtGEnrt2fd6CnvPHUm7jza+w=; b=nUwY4LbUbRHV QHnLzFV82nhid/V0MywrCjhgSzyX6C706q4Hd1XFrhsE0NUKzl/b8vW9Eiu4D6SR/CMxExNNLSI1h /BxF41Ay7z5p6cmruYv6y0l2q0Wbz13WCxKsGXzyNx4jsM0L1K0i3iq/aMzoZNehyeXP9yZL4AqKd vW5A0Mo7N8J5ArcXDOwgOuVp2q7RvJZBl8w6mWaV3YNhGN8N0vCyzq/G/5Q9rNoQ1HUwCsgG7Zlq4 rQFBaxJZyAKHSmgsphvJmAuh3LomA2Xo8pdW6uSd6CUxdh4vJ3lacnyRwwf+AtpALn5R8FqfyFj06 ZgaSfhqGQw2MVvXkn42bHw==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rentL-0000u5-6y; Mon, 26 Feb 2024 22:12:27 -0500 From: Richard Stallman To: Philip Kaludercic In-Reply-To: <87frxgn73g.fsf@posteo.net> (message from Philip Kaludercic on Sun, 25 Feb 2024 10:58:27 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87ttm7gi9i.fsf@posteo.net> <87sf1obkw9.fsf@posteo.net> <871q93rzv8.fsf@posteo.net> <87frxgn73g.fsf@posteo.net> Message-Id: Date: Tue, 27 Feb 2024 03:12:27 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) [[[ 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 don't think this command should be bound by default at all. Just like > by default M-u is bound to `upcase-word', but the user might decide to > rebind the key to the more powerful (or more confusing) DWIM command > `upcase-dwim', here too, I just want to propose offering an opt-in > alternative that the user can bind wherever they please. Making the > decision for them would be too invasive IMO. Maybe you're right -- but let's find out what users think of it. It may turn out that users will love having this command on M-DEL. -- 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) From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 12:15:57 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 16:15:57 +0000 Received: from localhost ([127.0.0.1]:47088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZk-0003Fk-To for submit@debbugs.gnu.org; Fri, 03 May 2024 12:15:57 -0400 Received: from mout02.posteo.de ([185.67.36.142]:41375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2vZe-0003EU-VN for 69097@debbugs.gnu.org; Fri, 03 May 2024 12:15:52 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E81DD240101 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:22 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWG9k3qfxz9rxG for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:15:22 +0200 (CEST) Resent-To: 69097@debbugs.gnu.org Resent-From: Philip Kaludercic Resent-Date: Fri, 03 May 2024 18:15:22 +0200 Resent-Message-ID: <87plu26fdx.fsf@posteo.net> Received: from proxy02.posteo.name ([127.0.0.1]) by dovecot15.posteo.name (Dovecot) with LMTP id XI9MEvjM0mVoVAMAB3Nl4w for ; Mon, 19 Feb 2024 04:44:48 +0100 Received: from proxy02.posteo.de ([127.0.0.1]) by proxy02.posteo.name (Dovecot) with LMTP id v3RYFPPM0mUHxgAAGFAyLg ; Mon, 19 Feb 2024 04:44:48 +0100 Received: from mailin06.posteo.de (unknown [10.0.1.6]) by proxy02.posteo.de (Postfix) with ESMTPS id 4TdT1q6y0Hz11l3 for ; Mon, 19 Feb 2024 04:44:47 +0100 (CET) Received: from mx04.posteo.de (mailin06.posteo.de [127.0.0.1]) by mailin06.posteo.de (Postfix) with ESMTPS id DFC2D219F8 for ; Mon, 19 Feb 2024 04:44:47 +0100 (CET) X-Posteo-Spam-Status: v=1; e=base64; a=aes-256-gcm; d=c5obbiwP2UkpCMPgZ83eZyfSi+5ugxzsQhXJcVo1uPWLS1ZcCodogmtUEdqOkSM4e1BdNIeck g+gjkC7R/cXDudXgBDFARe9pDWOlJFN6qpuw/ZUuWo/cVlEoz6PVVC5msZHgJMbFwr0KXaB22RR ttvlF4pKZpSFa8WP/zxYl9NARGJinsnsOD/B15gDf/IZAvheRu5cQbIQLM6C7QqG9HE4SaoYVgP U7sy9r8yEW+u+9Dpey+8TW5eDcd69sj7keaopOTFHnj7HuY+05JeeVl8S/HI/o5twUmIIRqu1hj 5qoyTA6rYKJuhPpg85YozMvPUrDQcc/DNYcHxhFN7Q2muOTILY Authentication-Results: posteo.de; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: posteo.de; spf=pass smtp.mailfrom=gnu.org X-Posteo-Antispam-Signature: v=1; e=base64; a=aes-256-gcm; d=S2Um7waiqCeuLo/fTBu+b0NIDyBykWPAbifNcVqdkIhJiw1g3qVKOQKvy0RF+TqNoTnyxT6mfeS1MiUZztM5PuWhSesFossFazyeCwwbJN+327lJd2HmZggqMPqqR4CNEqWCIxOy Authentication-Results: posteo.de; dkim=pass (2048-bit key) header.d=gnu.org header.i=@gnu.org header.b=sfBXXWGx; dkim-atps=neutral X-Posteo-TLS-Received-Status: TLSv1.2 Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mx04.posteo.de (Postfix) with ESMTPS id 4TdT1q1dwTz11ww for ; Mon, 19 Feb 2024 04:44:47 +0100 (CET) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbuaD-0003OZ-3H for philipk@posteo.net; Sun, 18 Feb 2024 22:44:45 -0500 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=kGGU3i5EkN49lpwa0ZYIosQiZPXxM0XoYWnS5lf/G8E=; b=sfBXXWGxvn19 IgCPEYaAe0PSlw6Mjeg8547MedQ/lfgnRXJXb7/aDF1LI9RzNQeq8IpuXHqH7psXtgS8YxG9WT5X/ WvwJYgykW3fdS7FbdH6UjHiSpuCMHTj9JYwZfDBGiF3jmpXotE6h5wkOhADmypXXv8RxBUJ9HHA+S U3pJqpUxOHwOUD2VeDSthrZmasyCf6nOlLaeg3Izc6t67Fs3E/lSGl+5Oy6ZLuq58AWC6zc6Xuzoa xfCs7s81Uyi5mDZJ+3n5+DU7Ydf5pSwPs/Pp1xjA78kda6ludao7nyBePHBeCt0djBetPKtsOBztq hWEwCVrglNABv6KxE28AZg==; Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rbuaC-0001Uh-JI; Sun, 18 Feb 2024 22:44:44 -0500 From: Richard Stallman To: Philip Kaludercic In-Reply-To: <87ttm7gi9i.fsf@posteo.net> (message from Philip Kaludercic on Sat, 17 Feb 2024 16:36:25 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87ttm7gi9i.fsf@posteo.net> Message-Id: Date: Mon, 19 Feb 2024 03:44:44 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: rms@gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) [[[ 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. ]]] How does it decide whether to kill a region or a word? -- 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) From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 12:20:50 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 16:20:50 +0000 Received: from localhost ([127.0.0.1]:47116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2veT-0003Jq-Ml for submit@debbugs.gnu.org; Fri, 03 May 2024 12:20:50 -0400 Received: from mout01.posteo.de ([185.67.36.65]:55617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2veS-0003Ji-0M for 69097@debbugs.gnu.org; Fri, 03 May 2024 12:20:48 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A2999240027 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 18:20:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714753219; bh=5zzrFFr0hqFJjSWPK1ZG+gy+sq7LWLn49D1949wbZuc=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=U+o423d3tJLMlqOK/Ab9m9HWFOVLRaWbU5fU9A+3tdPmTojYPDCFMExeT+xNIewDH FkePdXACDD1nAEl87kmwyCJn5YW5GnEaEaZHZKDEq9r2AofHp5VgJuR4Hmrpm8YKhS Km+N50/NN49Qonsbf0FYG2fM12sBsLoewsJ1ef0DLYJaqkeurG+lanuGIT1yNV80E0 33lL0aU5bDKnzYQQhxYmhoe4Wr6Qiu1+PPq6dR9Ih1VP1AQLv/taLzF2jIqwpACIL8 zPCkhSr1VgAlpW4zAzfii19JdpgGhtQLVPnt68H2BT3mjkHWRDnftEiZWgc3vtSwQO MrEbfAopfJedg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWGHR1447z9rxD; Fri, 3 May 2024 18:20:19 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86v83vi2kr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 May 2024 13:59:00 +0300") References: <871q9g8z8k.fsf@posteo.net> <87wmob73ds.fsf@posteo.net> <861q6jji0i.fsf@gnu.org> <87o79n6uj6.fsf@posteo.net> <86v83vi2kr.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 03 May 2024 16:20:18 +0000 Message-ID: <87jzka6f5p.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: 69097@debbugs.gnu.org, Richard Stallman >> Date: Fri, 03 May 2024 10:48:13 +0000 >> >> Eli Zaretskii writes: >> >> >> ping? I had a discussion with RMS off-list and he seemed to be >> >> supportive of the change. >> > >> > That's a problem with off-list discussions: no one knows about them. >> >> I also realised this too late, if you want to I can resend the messages. > > I think that would be a good idea, at least for posterity. So please > do. Done, let's see if my mail server allows it. >> > More to the point, can you explain why we need this, given the >> > existence of kill-word? >> > >> > Also, this kills backward, something that is not evident, neither from >> > the name of the command nor from the doc string (and the obscure >> > reference to Unix doesn't help, IMO). >> > >> > Finally, having another command that kills the region doesn't seem >> > justified, or is it? >> >> The motivation is sort of the same as with generalising `upcase-word' to >> `upcase-dwim'. If there is no active region, it behaves like >> `backward-kill-word' (which is what C-w does in a terminal as well), but >> if there is an active region it reverts to `kill-ring-save'. > > If so, then (assuming we decide to accept this change), the name of > the command should be something like kill-word-dwim, and the doc > string should mention the two commands you refer to above. I am not sure if the analogy is that perfect, but I certainly can mention `backward-kill-word' and `kill-ring-save'. >> I have this in my personal configuration for ages, and it is always >> one of the first things I re-implement when using an Emacs without a >> custom init.el. > > Any reason why you need this command and cannot settle for the two > commands it replaces heuristically? Are you using Emacs with > transient-mark-mode on or off? With transient-mark-mode on. I have a mixed habit of using C-w in terminals and in Emacs, and which one I want to use correlates pretty well with there being an active region. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 13:33:12 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 17:33:12 +0000 Received: from localhost ([127.0.0.1]:47855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2wmW-0004kJ-5q for submit@debbugs.gnu.org; Fri, 03 May 2024 13:33:12 -0400 Received: from mout02.posteo.de ([185.67.36.66]:45877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2wmQ-0004jt-Oa for 69097@debbugs.gnu.org; Fri, 03 May 2024 13:33:10 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 52B0A240103 for <69097@debbugs.gnu.org>; Fri, 3 May 2024 19:32:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714757557; bh=DLJKRfxBSIU6M3VrMjgKV+CZyIZFNZDUSSFJA22VWGs=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=VWaFDYWiGY0eFN0OIInIxvIKfZ4HunsCzFKOH+sOehjDX97sWylqeFwB9hoCTolh2 6vvspN+gA2zUcsU4VokpDAusdsHAccs3c5ynYScoNRS5zIfG189vtwvk92mgxnRtIZ m5p0o6G1qq5LOuN3cmJic5C5IiBJ4fRQZjiagvHO9/ZTbz5sEWS5H18t7+d2Xcp+lw tTkWs56/Zhwg6ydF/mA1Zk/4seeM4uFUasI90qPJwJXu/9IVN4HTeV4cSsace1qqL6 qgQ+KGHwLeDOdYp1qFYFJRhG4mDYFR6tpmjr52ZuvBlJwb19NN68TRZpryIeJHsVQU fBAColWO4NqSQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWHtr56hwz9rxL; Fri, 3 May 2024 19:32:36 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86seyzi2by.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 May 2024 14:04:17 +0300") 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> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 03 May 2024 17:32:35 +0000 Message-ID: <87cyq26bt8.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> Cc: rms@gnu.org, 69097@debbugs.gnu.org >> Date: Fri, 03 May 2024 13:59:00 +0300 >> From: Eli Zaretskii >> >> > From: Philip Kaludercic >> > Cc: 69097@debbugs.gnu.org, Richard Stallman >> > Date: Fri, 03 May 2024 10:48:13 +0000 >> > >> > > More to the point, can you explain why we need this, given the >> > > existence of kill-word? >> > > >> > > Also, this kills backward, something that is not evident, neither from >> > > the name of the command nor from the doc string (and the obscure >> > > reference to Unix doesn't help, IMO). >> > > >> > > Finally, having another command that kills the region doesn't seem >> > > justified, or is it? >> > >> > The motivation is sort of the same as with generalising `upcase-word' to >> > `upcase-dwim'. If there is no active region, it behaves like >> > `backward-kill-word' (which is what C-w does in a terminal as well), but >> > if there is an active region it reverts to `kill-ring-save'. >> >> If so, then (assuming we decide to accept this change), the name of >> the command should be something like kill-word-dwim, and the doc >> string should mention the two commands you refer to above. >> >> > I have this in my personal configuration for ages, and it is always >> > one of the first things I re-implement when using an Emacs without a >> > custom init.el. >> >> Any reason why you need this command and cannot settle for the two >> commands it replaces heuristically? Are you using Emacs with >> transient-mark-mode on or off? > > And one more question: currently C-w signals an error if there's no > region. So another idea is to extend C-w to delete the word at point > if there's no region (where "no region" means "no active region" if > transient-mark-mode is ON, otherwise it means "no mark set"). That is basically what my command does (with the difference that I don't just check if (mark) is non-nil but also if (use-region-p) is non-nil), just not part of kill-region. I don't know if this is too invasive, if users are used to this error being signalled. Perhaps it can be protected by a user option? -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 14:02:18 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 18:02:18 +0000 Received: from localhost ([127.0.0.1]:47985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2xEg-0005Ly-9T for submit@debbugs.gnu.org; Fri, 03 May 2024 14:02:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2xEd-0005Lr-Er for 69097@debbugs.gnu.org; Fri, 03 May 2024 14:02:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2xEB-0006U8-GA; Fri, 03 May 2024 14:01:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gDRMQjcOWX4vV8QndGwGwUM+Fue7RsQ9WnJ8xtxNc/4=; b=FOhKGzjv6HuF kUxrePYzSR7QqSIA1FxnRYpzNO8Uq8BET6XvbMPFDOveoilUR5cayK/pDnF9okbWMg90gjZOae7sr tXPIN5EDvFzmSqZuzQtlt1gt/tTaGWFwhFnNDUpWuB6rqrdonf2UWk/8jPRuzTIyu/yc4tPNkIbnr 1uev9/hcBASTCQepAFA5SI0/SFkDc/4ErJtNqZXoIj+hQ1kDjKuUFW4zYLjVgMKstSK985S5cSOAy BMpHo5A+L80/PcLSjGdreUfN0Jm6YUTVvAS1K1cHqzmJFvFXwSvBBWidWFC3yZXGiPmrYmAvr5RAn if4mAdBP6K7nXI+BgachoA==; Date: Fri, 03 May 2024 21:01:38 +0300 Message-Id: <864jbeixkt.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87cyq26bt8.fsf@posteo.net> (message from Philip Kaludercic on Fri, 03 May 2024 17:32:35 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: rms@gnu.org, 69097@debbugs.gnu.org > Date: Fri, 03 May 2024 17:32:35 +0000 > > Eli Zaretskii writes: > > >> Cc: rms@gnu.org, 69097@debbugs.gnu.org > >> Date: Fri, 03 May 2024 13:59:00 +0300 > >> From: Eli Zaretskii > >> > >> > From: Philip Kaludercic > >> > Cc: 69097@debbugs.gnu.org, Richard Stallman > >> > Date: Fri, 03 May 2024 10:48:13 +0000 > >> > > >> > > More to the point, can you explain why we need this, given the > >> > > existence of kill-word? > >> > > > >> > > Also, this kills backward, something that is not evident, neither from > >> > > the name of the command nor from the doc string (and the obscure > >> > > reference to Unix doesn't help, IMO). > >> > > > >> > > Finally, having another command that kills the region doesn't seem > >> > > justified, or is it? > >> > > >> > The motivation is sort of the same as with generalising `upcase-word' to > >> > `upcase-dwim'. If there is no active region, it behaves like > >> > `backward-kill-word' (which is what C-w does in a terminal as well), but > >> > if there is an active region it reverts to `kill-ring-save'. > >> > >> If so, then (assuming we decide to accept this change), the name of > >> the command should be something like kill-word-dwim, and the doc > >> string should mention the two commands you refer to above. > >> > >> > I have this in my personal configuration for ages, and it is always > >> > one of the first things I re-implement when using an Emacs without a > >> > custom init.el. > >> > >> Any reason why you need this command and cannot settle for the two > >> commands it replaces heuristically? Are you using Emacs with > >> transient-mark-mode on or off? > > > > And one more question: currently C-w signals an error if there's no > > region. So another idea is to extend C-w to delete the word at point > > if there's no region (where "no region" means "no active region" if > > transient-mark-mode is ON, otherwise it means "no mark set"). > > That is basically what my command does (with the difference that I don't > just check if (mark) is non-nil but also if (use-region-p) is non-nil), > just not part of kill-region. I don't know if this is too invasive, if > users are used to this error being signalled. Perhaps it can be > protected by a user option? I don't think anyone wants the error, so doing something useful in that case should be a no-brainer. From debbugs-submit-bounces@debbugs.gnu.org Fri May 03 15:42:21 2024 Received: (at 69097) by debbugs.gnu.org; 3 May 2024 19:42:21 +0000 Received: from localhost ([127.0.0.1]:48396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2ynV-0006bg-3v for submit@debbugs.gnu.org; Fri, 03 May 2024 15:42:21 -0400 Received: from mout01.posteo.de ([185.67.36.65]:45107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2ynP-0006bY-Af for 69097@debbugs.gnu.org; Fri, 03 May 2024 15:42:19 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0A79524002A for <69097@debbugs.gnu.org>; Fri, 3 May 2024 21:41:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714765307; bh=bu8itpycT4mOOuFSNyB5iaFKdhKjWMyUSXTBYTlYR4E=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Jy0rIIi8AlTBatXsN1/f7tF54ZGZ17gUYa2KQxhFNH/MVSEebCuoHPkDirwc3Vw1z HrJeij8ki9/Wv0PMp6OYGAn2YinZ+aeoTWAsAnbkWq5Q1U8HypsbWfQfkDN/K2C8QQ YSv6t2g1SWx5UXeE4ON9V69c5WaCH1YmMrJKrtSa/OUiOAVL84P+zU0ErZBVBo8htf GDLXTciNAUvmq/OVC27/E+0ECrFjtw6EWC3XU6NCaZfk03sn4+M3vjLnwmozOBR6f0 6NK8c7G1lfDzgWe3Zq4FYC9iFIDtDnxsYmOjPiMv9eJAaVxuSNLMY2Asuqdh7ZyAGE veJDbOWTE0ovQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VWLls5Zvpz6tyK; Fri, 3 May 2024 21:41:45 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <864jbeixkt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 May 2024 21:01:38 +0300") 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> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 03 May 2024 19:41:43 +0000 Message-ID: <874jbe65u0.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: rms@gnu.org, 69097@debbugs.gnu.org >> Date: Fri, 03 May 2024 17:32:35 +0000 >> >> Eli Zaretskii writes: >> >> >> Cc: rms@gnu.org, 69097@debbugs.gnu.org >> >> Date: Fri, 03 May 2024 13:59:00 +0300 >> >> From: Eli Zaretskii >> >> >> >> > From: Philip Kaludercic >> >> > Cc: 69097@debbugs.gnu.org, Richard Stallman >> >> > Date: Fri, 03 May 2024 10:48:13 +0000 >> >> > >> >> > > More to the point, can you explain why we need this, given the >> >> > > existence of kill-word? >> >> > > >> >> > > Also, this kills backward, something that is not evident, neither from >> >> > > the name of the command nor from the doc string (and the obscure >> >> > > reference to Unix doesn't help, IMO). >> >> > > >> >> > > Finally, having another command that kills the region doesn't seem >> >> > > justified, or is it? >> >> > >> >> > The motivation is sort of the same as with generalising `upcase-word' to >> >> > `upcase-dwim'. If there is no active region, it behaves like >> >> > `backward-kill-word' (which is what C-w does in a terminal as well), but >> >> > if there is an active region it reverts to `kill-ring-save'. >> >> >> >> If so, then (assuming we decide to accept this change), the name of >> >> the command should be something like kill-word-dwim, and the doc >> >> string should mention the two commands you refer to above. >> >> >> >> > I have this in my personal configuration for ages, and it is always >> >> > one of the first things I re-implement when using an Emacs without a >> >> > custom init.el. >> >> >> >> Any reason why you need this command and cannot settle for the two >> >> commands it replaces heuristically? Are you using Emacs with >> >> transient-mark-mode on or off? >> > >> > And one more question: currently C-w signals an error if there's no >> > region. So another idea is to extend C-w to delete the word at point >> > if there's no region (where "no region" means "no active region" if >> > transient-mark-mode is ON, otherwise it means "no mark set"). >> >> That is basically what my command does (with the difference that I don't >> just check if (mark) is non-nil but also if (use-region-p) is non-nil), >> just not part of kill-region. I don't know if this is too invasive, if >> users are used to this error being signalled. Perhaps it can be >> protected by a user option? > > I don't think anyone wants the error, so doing something useful in > that case should be a no-brainer. How does this look like: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Allow-kill-region-to-delete-the-last-word.patch >From c64fa2065e88c4e4848bf8a15161c82ae6d1c2bd Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 3 May 2024 21:38:51 +0200 Subject: [PATCH] Allow 'kill-region' to delete the last word * lisp/simple.el (kill-word-if-no-region): Add new user option to allow 'kill-region' to kill the last word if no region is active. The intention is to mirror the conventional C-w binding found in many Unix shells. (kill-region): Respect 'kill-word-if-no-region'. * etc/NEWS: Mention the change. (Bug#69097) --- etc/NEWS | 6 ++++++ lisp/simple.el | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index d4177d759f3..a0f2472ab67 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -416,6 +416,12 @@ When visiting a script that invokes 'env -S INTERPRETER ARGS...' in its shebang line, Emacs will now skip over 'env -S' and deduce the major mode based on the interpreter after 'env -S'. +--- +*** New user option 'kill-word-if-no-region'. +This option will modify the fall-back behaviour of 'kill-region' if no +region is active, and will kill the last word instead of raising an +error. + ** Emacs Server and Client --- diff --git a/lisp/simple.el b/lisp/simple.el index a459f6ecfd2..7fade562909 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5790,6 +5790,11 @@ kill-read-only-ok :type 'boolean :group 'killing) +(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) + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5812,25 +5817,36 @@ kill-region the text, but put the text in the kill ring anyway. This means that you can use the killing commands to copy text from a read-only buffer. -Lisp programs should use this function for killing text. - (To delete text, use `delete-region'.) -Supply two arguments, character positions BEG and END indicating the - stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current - region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." +Lisp programs should use this function for killing text. (To delete +text, use `delete-region'.) Supply two arguments, character positions +BEG and END indicating the stretch of text to be killed. If the +optional argument REGION is non-nil, the function ignores BEG and END, +and kills the current region instead. If REGION has the special value +`kill-word', then it will kill the previous word, as with +`backward-kill-word'. Interactively, REGION is always non-nil, and so +this command always kills the current region." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) - (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + (cond + ((and beg end (use-region-p)) + (list beg end 'region)) + (kill-word-if-no-region + (list beg end 'kill-word)) + ((user-error "The mark is not set now, so there is no region")))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((eq region 'kill-word) + (let ((end (point))) + (save-excursion + (forward-word -1) + (filter-buffer-substring (point) end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) @@ -5857,6 +5873,7 @@ kill-region ;; If the buffer isn't read-only, the text is. (signal 'text-read-only (list (current-buffer))))))) + ;; copy-region-as-kill no longer sets this-command, because it's confusing ;; to get two copies of the text when the user accidentally types M-w and ;; then corrects it with the intended C-w. -- 2.44.0 --=-=-= Content-Type: text/plain -- Philip Kaludercic on peregrine --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 04 02:21:03 2024 Received: (at 69097) by debbugs.gnu.org; 4 May 2024 06:21:03 +0000 Received: from localhost ([127.0.0.1]:51484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s38la-0006HG-HS for submit@debbugs.gnu.org; Sat, 04 May 2024 02:21:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s38lY-0006Gj-6W for 69097@debbugs.gnu.org; Sat, 04 May 2024 02:21:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s38l5-0002OT-M3; Sat, 04 May 2024 02:20:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Lx2Qj5kkuovbnBVR+I3lVt85HV474J/R3Ky3YQZ9aPQ=; b=l9HG77M77Mue QdW04KZDh7RkNPgAMRWIsz+t/5HGp/M5qmGnI0hcA9Ui97qzFRKOVq6u/cfuS8+Ckkp6bs18bMdX8 xU9xGwby0wZNheHpasOIkWYkNXNXleF0GnKReAvK68i+5Jf2qQKKzG8cDQkOJNqEsh/XSdLX717SJ o5Y0INsplgq1VqEER+LB2MYL7SEOaWPraoyBo7pJkzwL9r/XDbfyMDHXIN0QAWBo07KTqIz581mfr eOek6Fnnd0l5WOPJjnVOfEeRTjhYx/xI7sp2CxS7zlDhy6LwvURWgSfhIHJs/B0r0whhvG4HCmoQY c5OBUrcT4Qdyk7Yc+5b43Q==; Date: Sat, 04 May 2024 09:20:13 +0300 Message-Id: <861q6ihzdu.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <874jbe65u0.fsf@posteo.net> (message from Philip Kaludercic on Fri, 03 May 2024 19:41:43 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: rms@gnu.org, 69097@debbugs.gnu.org > Date: Fri, 03 May 2024 19:41:43 +0000 > > Eli Zaretskii writes: > > > I don't think anyone wants the error, so doing something useful in > > that case should be a no-brainer. > > How does this look like: Looks good, but it needs some polish, I think: > +--- > +*** New user option 'kill-word-if-no-region'. > +This option will modify the fall-back behaviour of 'kill-region' if no > +region is active, and will kill the last word instead of raising an > +error. This should be modified according to comments below, and also should say what is the default of this option. > +(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) This lacks the :version tag. > +Lisp programs should use this function for killing text. (To delete > +text, use `delete-region'.) Supply two arguments, character positions > +BEG and END indicating the stretch of text to be killed. If the > +optional argument REGION is non-nil, the function ignores BEG and END, > +and kills the current region instead. If REGION has the special value > +`kill-word', then it will kill the previous word, as with > +`backward-kill-word'. Instead of "the previous word", I would say "word characters before point", since we don't kill the entire word if point is inside a word. > Interactively, REGION is always non-nil, and so > +this command always kills the current region." This is not accurate, is it? If you invoke C-w immediately after starting "emacs -Q", C-w currently signals an error. Also, the new user option should be mentioned here with its effect on what happens in that case. > + (cond > + ((and beg end (use-region-p)) > + (list beg end 'region)) > + (kill-word-if-no-region > + (list beg end 'kill-word)) > + ((user-error "The mark is not set now, so there is no region")))))) > + If transient-mark-mode is OFF and kill-word-if-no-region is non-nil, this will always kill the previous word, right? I think this is not what we want, so I think the above should work specially if transient-mark-mode is turned OFF. Finally, this needs the suitable changes in the manuals. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 03:01:36 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 07:01:37 +0000 Received: from localhost ([127.0.0.1]:58093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3VsO-0001oj-M3 for submit@debbugs.gnu.org; Sun, 05 May 2024 03:01:36 -0400 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:37165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3VsM-0001oA-00 for 69097@debbugs.gnu.org; Sun, 05 May 2024 03:01:34 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 8247C1BF204; Sun, 5 May 2024 07:01:01 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <874jbe65u0.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 03 May 2024 19:41:43 +0000") Organization: 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> Date: Sun, 05 May 2024 09:53:19 +0300 Message-ID: <8634qwkbtc.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > +(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. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 05:05:44 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 09:05:44 +0000 Received: from localhost ([127.0.0.1]:58568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3XoW-0002rW-0O for submit@debbugs.gnu.org; Sun, 05 May 2024 05:05:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3XoS-0002rJ-52 for 69097@debbugs.gnu.org; Sun, 05 May 2024 05:05:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3Xny-0005Aq-TN; Sun, 05 May 2024 05:05:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=onl3A4HmwtR5kwk7lNPHeFVAN6yMGJlahZEANalABzo=; b=pm/MoXLDTCaa GBMkRgJHEz/+6ZRwNA2LkjBwVdih4JikhP56QdVreoBjD5lQJmRReX4lOo6ekzR+TxkTw8e8sIIme 29Q5mtzRrzBsxVMiY1LM8draUZg+vw9UQV71SO94qnglX3PYWO/dgEaZ8hrhV/ZDhN9M16/0P0MN3 T4k8uFfrR/SJcCs1LSsMHvCEIUzefnb39+3aIlw9r/4CLnXUrwhA+ESW31QoKlRIZvAgbScCi57NO S8cu1HxnD02JE4trIxITYixrvcNbMcNp6DIqUpSoGpEjdOajnyfXs8WMdJye1adX64QgI3LKT3OtZ PXWJudUm3Iz5QGq3CJt5bQ==; Date: Sun, 05 May 2024 12:04:49 +0300 Message-Id: <86h6fceij2.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <8634qwkbtc.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 05 May 2024 09:53:19 +0300) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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?). From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 12:44:53 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 16:44:53 +0000 Received: from localhost ([127.0.0.1]:60615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3eyr-0001a2-BW for submit@debbugs.gnu.org; Sun, 05 May 2024 12:44:53 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:47193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3eyo-0001Zl-Te for 69097@debbugs.gnu.org; Sun, 05 May 2024 12:44:51 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5A3B240002; Sun, 5 May 2024 16:44:19 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86h6fceij2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 May 2024 12:04:49 +0300") Organization: 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> Date: Sun, 05 May 2024 19:29:18 +0300 Message-ID: <86zft4jl5d.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> > +(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. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 12:48:02 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 16:48:02 +0000 Received: from localhost ([127.0.0.1]:60645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3f1u-0001dP-8d for submit@debbugs.gnu.org; Sun, 05 May 2024 12:48:02 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:28340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3f1q-0001dC-FG for 69097@debbugs.gnu.org; Sun, 05 May 2024 12:48:00 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4455TXMf017709; Sun, 5 May 2024 16:47:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=WJfDC21huVsERxte0sQF1Nm1AT9VYB9N18Gpd+cnxZw=; b=dUgHl9bWyj/X6+DZjvrudc0HTyy9YTjb1YASdD4nxmgZvr20oDFGSUYM+xZEinJjOW0D VQNooCRnPTb9qMMQgLgTAZl3ZdxfA5gUVTc+IxVIuRvUqgN0Q7vCQkecvkWQaNPTmMOc CDRdL0afkLDUDEgLUGmPMP6FCaRhV1u6xHh6mzcBJ2yZzmnonXp8+bOy7Uzo4sEUts// Kxu4fnJB+vJ46DJ/YflWJTWtYp2szQM2VS2eLaGPx/3j907PnMTRTWad55pQHHuYjwPS bcsgkAyuarvabu1l2xPHHOhvCfpaCrj4GK7LZsver66ymvvNGOZUd8q3/Gqe4R6ppJsa /Q== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xwbeesd9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 16:47:33 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 445GUISk040881; Sun, 5 May 2024 16:47:33 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xwbf50mav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 16:47:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CX/x760niGxsZBAlJkQy3spojkdEwZKt0QyFSUxMjzjI5Dud9I8W53X769GpfQb6sZz7niZr096s02wtesFdFGcOIB8ngGdNg45q+erObyqNZvuKmVm6AzzNukqzPmIPohHGr5ehjervkpidhG6m1OtXYAoDqk11l0Zsux1+iFFI5sci3utfhzhQ6f0fFro+0gvtmHEeWcq/nvHmrcw/Ch8HwqfqXMJqL8zO6f+w8JkbqXeaiR+lHExq2Pw77urt+PzfEAEU2f9lKZYm0QdRpAzgRn6fokfVfvjE/LXmULM0+z8FKm7B7QAZ44mE4ymRw/GjzSqD1IVH2QZV0Tf6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WJfDC21huVsERxte0sQF1Nm1AT9VYB9N18Gpd+cnxZw=; b=SRQ8dCBT8aZ9aQ6GmUrweaNGCLNoq2oavVbYgbL9MA4LrDWKG40mpAGTch3L8utcXGh1uRhNWqB5EEXPN000sKNKSJlPT8bXaRlJp3zXaCgNjHcG2faujKJkL82JEBvHQdD59buw3SB6ptsHSK1NvrbnJjdiVcALDYMHgnB+ptYP3vTAQp5N/ropLn0EfvO9YQSkijFtpygH9eFUKLyGxr0snWpxyeqMDoF2ENQ+qDR6zUHZ/CgugQ5hZ+vcC8+kp3c/ZxfWu0y6D+JzZ6zG9kkiaFFam/t/FXKAlMVKcChSZb5ZV+f0+J3Eb2aqKSNjTiS4nP3yXvLy31tUtB/N6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJfDC21huVsERxte0sQF1Nm1AT9VYB9N18Gpd+cnxZw=; b=y+DBfzWzSBlY9WfUKycFQceyhZ9ZHjmZnOGbqwM4u4m+rATUWJ2wndYr3bhmV5KTJ3whJ1Ci+VDpRJIkKTvn8gJ90m1459vDyk59a1KtYwfKuqd367taKjJr9EC2CuPTUpJKrnQnbmylgoj/KIRZglMiVGNqOkcmY8AZOlekf+M= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by DS0PR10MB6054.namprd10.prod.outlook.com (2603:10b6:8:cd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Sun, 5 May 2024 16:47:30 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a%7]) with mapi id 15.20.7544.039; Sun, 5 May 2024 16:47:30 +0000 From: Drew Adams To: Juri Linkov , Philip Kaludercic Subject: RE: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Topic: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Index: AQHanro/5pQeUGgmu0aL8GQ4hjE4tLGI1EFQ Date: Sun, 5 May 2024 16:47:30 +0000 Message-ID: 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> In-Reply-To: <8634qwkbtc.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|DS0PR10MB6054:EE_ x-ms-office365-filtering-correlation-id: cabbe2a1-754f-413f-6dd7-08dc6d230ded x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|376005|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?6yDXkhQA4KgvVx3jlaF24q9dPG6CDR55ApZEnk+Clmj6Y3t1Rbj1rX6S5Wh7?= =?us-ascii?Q?1Cd1fTG1J+Tt09Cs81xkgrmdYPQm/KHJcXQcdKmpbp0QLYGbcQ4OyZ5j/sZc?= =?us-ascii?Q?HG9cSwSLjdVTKjmCrCUabouO5V8uAmz9J0IlUYMHPXud7ukw8lchEaphBdB8?= =?us-ascii?Q?eLmHfVHCPHFupY/kFj/40N3DujNXyL6r88c1i6LbaC/haR8bDgoIPs0AbY6o?= =?us-ascii?Q?mdCqZjoC+nx98nhGMsmXbq/fdxEiF3CwVmi84IRf1OcH+jK5pL8IqQM6pxDR?= =?us-ascii?Q?ICd9MDyZixmAjOffp4e2Yv8PZSluG0HeSCLcZi8LJoWrl6tiwYzyPpbOOMKF?= =?us-ascii?Q?fPiGwlZI0+mJ1VEgkkxsvdPv8wBxIV4jF9Jze+djRUR61CRfZiPe66P7bE4I?= =?us-ascii?Q?9HO8EtSNSOPEBqyYR4QXhpxGfnd/BD7ys8tOKWQc4AKSU9R+5BzfmZut6ZML?= =?us-ascii?Q?pyGbjG9QMi1TEhYEDU8bSBAqKUpZxxrwlZVeikLJENN5ru1j4lXvAVmVx53t?= =?us-ascii?Q?nYbObgHcj4oUvwrihFe39JK/3cOFcPlD0Ps5kjPVfosC7pUcoJq+plf0Pwjw?= =?us-ascii?Q?L5wQIOv8gXqp3gffooMisZIWsDo3Rk1lzPuz7929WJBwCjlHv7/Idlm6fho6?= =?us-ascii?Q?xJY3/SBjNNZ70g+Pxhqpz8t0lmMwngm5pRoT2ykx9YScfEGB+nOz9Iuplh3O?= =?us-ascii?Q?bg2L3evCgdxhFkHz56H38g+CTJOm6uMDnII9mp49sh7SiITKT+Q059cqsCQl?= =?us-ascii?Q?LDhkiLFkNswVjYZVaEXMTCcdOoIwEpGhL/efLapuCG5AbLOtnhitk1MsZqV8?= =?us-ascii?Q?lsAR+M6y+G/PvCxEVKlJwJ+SHotDgjzqiwyqV+2vHUwAmAabS/ywizfdiSim?= =?us-ascii?Q?2OZY/CfLRNINXeLiBwDSXYqPFok5PIjewhWW2iSS+zutJd4cJ+EL2Fy7u/qn?= =?us-ascii?Q?4r9uN6+pdA+sn82HFPX1et3sHHhqliXlrlLgcQ/syrSvBBkOSRw5tP8QMw8Q?= =?us-ascii?Q?a5zel6bDr9DLmqrm5Xw/zeXX5cqdB2iztgalePmKKPOSCgvKcXvlFcwbFn+Z?= =?us-ascii?Q?h1a+9YN79YwB9OFEXSXGZsrz6X/KRz8/mROnEjU9DFkATFSyZffyBG1RAp2W?= =?us-ascii?Q?021pdnaw/OnIgVP4hYgYjDI5g4oRFHsZyBpICfyvMvbgJwNvF5/4joR6wpQa?= =?us-ascii?Q?xLUfMKSwv4jC9irMCwABst804n1Qw5NBYg2/N3GKv2javA0zGvhvwpjatnZJ?= =?us-ascii?Q?t5vbULC1Ij5fn4yJ++SaZQyA3rROUkQROZL28RCwFQcgSvWBOZktpSW0gfSo?= =?us-ascii?Q?MYadQxEsuaUNIFe1SceOv0NYqnvhbBXAuSSmoPv25ht0AQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UhtPpU3bfdWcsTCy1O7gItuS4nykLxR7FLFG5zGSIwn4npFO0c9iiZy5v6le?= =?us-ascii?Q?4ZdHeT0ZJpGiVLHSII1BvH9DSHILYuTk24IGo+8wUBSpnBJbdlidoThSUMpL?= =?us-ascii?Q?wksbO7ae5r8sheqxvJTArHNkdZHTgdNSSTFN9YYDWAtloZtP6Rbnvin9REyv?= =?us-ascii?Q?nzBezntxqE0q7ymEx6BcHYNWsQnloVG+TPLnIMsf5fMa7N88t8PiF/ZiAXxO?= =?us-ascii?Q?G/3jYWuJ+G1Ooimo9pWvfBvzR9OzlCbLbuxTAePYTe715Z9kJDGkW2Hv05iB?= =?us-ascii?Q?/YJriaghizbsjpWkyc6VCUsaLNJZc0gqorkmFNp0hyacKfIOHDLQjgq2dJNp?= =?us-ascii?Q?QA8AMqJ6R27ArchDs9N4q7pWbRyRAQayhZA6vC38M4snjVqRDBdqSNXmIU5E?= =?us-ascii?Q?j+YYD3pj3je4PLg7LZp8bGpPi3I+H2J4B7Tk1zyrihfekf8xAJo8c7AB8hyA?= =?us-ascii?Q?qNqtby3WAcpPBVxNVho9IZ3VLgmxnSDXMiliJuDDx3FFBc8nSpIrXKGwNHN/?= =?us-ascii?Q?j5MA520jVG1IE41OE4eQ9D01S0g7+mqCdiza6/IvOr0HKjlrQ/wWCTqBKRGG?= =?us-ascii?Q?BcR02lKKDROFKLXFwUP84XTfHlWSLEXZLQqul7Q3S97r78uWTtTFRxlpwGLG?= =?us-ascii?Q?OX8EOYP6clX/gKfRSdgzTfmMnsTxrDj0P9ezQY3U5i4sBb8uEpu2CyP2QllP?= =?us-ascii?Q?6HF2fx4jZa/5ao4X87Xf6W8JCfl4POFOqtTEpAwXlFekKiGhO5i0gHgcSNID?= =?us-ascii?Q?HyGfF4QjXNcRmpjaLE6kpOVXmpfvB8ADpPrm08wPu22x/AmHPN0E5KoGbKHc?= =?us-ascii?Q?BAfSjVFrP7+DTTOemFIur5cT2t+LC6hIB4DxyCP/ydWWcHHh8z3OVGRdeucl?= =?us-ascii?Q?1aQ3IjjRxUzajXWgv7Ug+EV4wPRp6N04C2smuAN9qN9sSPsW8J6MgS4Bqr9k?= =?us-ascii?Q?EVYADhpGUNsRaAxNct0ixY8e8/jWpBT00CTPHL/3gg42va44qil5IRPKkp+5?= =?us-ascii?Q?33/JJDjvHg08/UA6X6Xwk3cOjiZ57ToAlNUI2pio07gFy2SLxssKnaJSBLdA?= =?us-ascii?Q?4A4YITea9UJDSKAnmrZgjwbWsQdnn0IwYuUjVg4A24bPkfa4lfQhOd688zQP?= =?us-ascii?Q?iHN/fOKXB5rmS7PkLQpeS+J9+LTa2E7daCfrPcAfY9Z+3P1NFwb2XS4zDay5?= =?us-ascii?Q?RI0lVCnhoEm2prEf/7sH328LeOg/SerEJ/sttsCdXPb+pn3V1UGlj+8J+qrO?= =?us-ascii?Q?S/S8YVEoyWkUTSt///Q6v5Hks7yFlqAUABWpatMM2PZuSNytZbONzxKkDhNP?= =?us-ascii?Q?5TemPBbE1NMpYKptR2caEq/SJDT2R/K5tXu0qpLTR3LHw8LFFyV7+e4u2mmN?= =?us-ascii?Q?ZYfp1rIaws1hidp8KW/Ega3RDbrEe+mPbaHThK/DZWBVSXBcGxcGBQcgF877?= =?us-ascii?Q?TsF5Nwvewl2svuXm/qgUjq1A4c/QpIGm8Hc+Lmjkc76W1PktxhbsfDOExcY5?= =?us-ascii?Q?eJ/3R2a3Rw6YG9QngpzPw0GVbeeMMZVzs0ynmlGcP6MQEo7p1ldmWEAgFw?= =?us-ascii?Q?=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 28a0viv2MFN13JtXQ2ArfP1DmTjms6s9Yg7DOJFjY4+ITZBGksEN+dIyVisN3c+aBhssSJL47WG2NkOTn9tXZvZUFb2CAni/1DBagjvocrVJcLASQ6ZLI2s7Gds6jw8x7bxKXtHUytqOTRThQYUSOZBNwyi7JEVZE0BJEbCAsCneqmMI5PjTV6uomZplg5JAwQUoNdH8ZYPdiBlNU5j3i0MuMGDYyPtvOvVT6QpkAuphKUWgoOIc3GT9oMNz4P2SbsAF0gGcw6BjTIotMt7PJzBOUM8GQYZbhJAhGNO/eQHU76dWhZ3Zfk6GYFCRlmqxi3wKNDCAo19lgq9QhIqFW//+Lutad/cx/U8vjFA+UvXBqENydoW5HmkLSfq8BRqlXuCcTCbDb5v8sGj1PQIv1ilTDBKyUzoTB23Xx4CHGREWFDpmNDk0NnATGr6chFQc7A3GZ0XobImGXO3eHsLDeT9cpIgQVy67ef4ZC6KwkPEpRq7I1Nkmne84jygi1xDYiMz+mWiPBVZLg3cq6wva0L/DbyU+owpaQzUji3YA+nXAGTKq37Z/V9SybFyFI0B+qBPbEkK1bK2uQc/8veShNGif69Yft+BlvuArne4r/bA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cabbe2a1-754f-413f-6dd7-08dc6d230ded X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2024 16:47:30.4563 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JiHlJoyNSQc/CRAv1yXZkgfIvGXsN2beKLCcuQB0s0s86U1EbgEudRGQxFTgf2us46T675vmauOAbdg4yoTjGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6054 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-05_11,2024-05-03_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405050074 X-Proofpoint-GUID: _LNsE9QcedPFBXy99SI2w4j5aVZxBm5F X-Proofpoint-ORIG-GUID: _LNsE9QcedPFBXy99SI2w4j5aVZxBm5F X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , "rms@gnu.org" , "69097@debbugs.gnu.org" <69097@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > > +(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) >=20 > 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. +1. Finally some sense in this thread. If there's no mark in a buffer when you use C-w the logical behavior is to raise an error telling you exactly that. Emacs was wise to do this. No mark means no region, which means no region to kill. (And how often does anyone see this error when using C-w?) ___ Just as bad as giving C-w this unhelpful behavior was redefining `kill-region' to give it the new behavior, instead of binding C-w to a new command. ___ Having no mark is different from having an empty region (whether or not transient-mark-mode is on). An empty region is a bona fide region. Killing an empty region works; as does yanking it. An empty string on the kill ring affects yanking just as one would expect. Code can depend on it. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 12:55:32 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 16:55:32 +0000 Received: from localhost ([127.0.0.1]:60675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3f9A-0001hH-CG for submit@debbugs.gnu.org; Sun, 05 May 2024 12:55:32 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3f97-0001h6-G9 for 69097@debbugs.gnu.org; Sun, 05 May 2024 12:55:31 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id ED665240028 for <69097@debbugs.gnu.org>; Sun, 5 May 2024 18:54:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714928100; bh=WHERTphYjlEArYeneMguS/un908hl6HYC+UfVuUwDtg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=cMPVTv5GJwQJpQLg+Y7+dGKttr24jtIFczyrk+lCTmVI/gxz05BXWE5nxhmbvXVnV F55QEnX1GWsUm8BPrUfPJP/7iGzML/vi9YuT8YadGnRFT+drXTDiiEw9zIIA/binkn 3xLOkZKb8R9+qgHMXNWYAqIouDuz6DvYs5gMjCEZFwGlh3DYO197e35KH01yYLW5mk uFkBMst+6HByQkZJt0rAiFQwt3cDeNNxnO3jLaFhcv6egWBMxjQGH0h4NmemDarkVD zQv4z/BUru4+Bwm5rcK39R43qEoRnSwh7hJYNXkwokrN3DwYlncqQBs/N/CSvOH5cg jWw5DNe3Pygpg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VXVyW2JK1z6tn4; Sun, 5 May 2024 18:54:59 +0200 (CEST) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86zft4jl5d.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 05 May 2024 19:29:18 +0300") 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> X-Hashcash: 1:20:240505:69097@debbugs.gnu.org::cp/dl8RTMrzWDzIV:Dlg X-Hashcash: 1:20:240505:rms@gnu.org::Ie0KNhuPCvJVJl5R:02W1 X-Hashcash: 1:20:240505:eliz@gnu.org::FEj13/wZLuBAa9zn:16iS X-Hashcash: 1:20:240505:juri@linkov.net::eD7SjZYdakOxloWc:2acw Date: Sun, 05 May 2024 16:54:57 +0000 Message-ID: <87plu05hcu.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >>> > +(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. -- Philip Kaludercic on icterid From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 13:00:57 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 17:00:57 +0000 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 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 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5B5B5FF806; Sun, 5 May 2024 17:00:15 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87plu05hcu.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 05 May 2024 16:54:57 +0000") Organization: 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> Date: Sun, 05 May 2024 19:59:46 +0300 Message-ID: <86jzk8i48t.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> > +(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. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 13:05:45 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 17:05:45 +0000 Received: from localhost ([127.0.0.1]:60738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fJ2-0001qG-TV for submit@debbugs.gnu.org; Sun, 05 May 2024 13:05:45 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:46108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fIy-0001qA-Gg for 69097@debbugs.gnu.org; Sun, 05 May 2024 13:05:42 -0400 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4453v53N025278; Sun, 5 May 2024 17:05:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=lRVLkza9qMNcPhrB18b2LoQz5dDWY/U+tXPuqEGM8dM=; b=DyEoj+0s15Qy1Z0LpT3Bsf6igPgeyE2aRI9PnCmSbeX3UI38iWW1GVNwU12SriaEMhq9 7d4jYl9JiqSAJjdNrZcUaHXok8bwWePUI+UIaYnig0izqi0sWx/bezi+K5kvdayckIFj EAYhgpHxAeJ1jbH4QNC3HEv6aTP68t+GFAGwISr9+8kVPcLQ993pieJr3TIjqB0fjzCm jr413i5H+edAZImK+ThIvVlhGB7WYPQkyBmSvN8EfOVSBvhQnoUR3frACAw9dcZ1wM+e zZHYhaW4B9vFPxyIqoCXhTL6h0avCzZghTiiqWcgujJA1q6qqD+Y11LnJS+AwXjKmwFn mg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xwbxcse9e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 17:05:15 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 445FUILe006951; Sun, 5 May 2024 17:05:14 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xwbf5sx2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 17:05:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jJ9H5VhGL2yQgLjy8dmC++Nqc7/Sliw500EvXh9MeJa0WkCSsGd+UlZl5DfdijWphyEn3PnSleRYeyabYH1/lq754PtN8X2fU/FIzJ5weUcil52DYkyqZWkarRCKB6BHeVe9zNWCPjb1Qx9tWobYU8LdFZkfTdD52JI7PLjZ3KtTpLqJ145kLpGE7B/JQHDwKFxGj32qab0qdikrwZam5aYtly+KvVgM3HXfPwWFbN/RuS2h5wU0KNqtZoH2Sl5BUFtW4uH5XsF2f+V6qyGNPsPEF3mMQW82Fc34cPmdI/eQc9GEE6mSWNOLKerZofK/a9mGr2eH3C6BqmX1y+nS8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lRVLkza9qMNcPhrB18b2LoQz5dDWY/U+tXPuqEGM8dM=; b=JKmVK8DrXLxjST3BVPl02tZZpJFgUlPyq2iN6KtMuq4jvuTb1SrClj17+auh4TeFsygmtJF9/m5K/EwAOpotSqxokBlF7qunchznDFdl8+UtJYqOTTdDmDAD/WjtWlMbEPunmw0KsGDTD19/lCxo+TwYSel9PcS0gLwGN51KQWhcFAq+VAO7m3MFub1F7CBWE712yxFikwI1hv3mYswzdymxmHTuqfI1tSGbwWrssee45JKdcV3Z/QS6Jbz3ZBHwxkyvzArmf6tGqahSpH4BX77iISLeggOG4rrY6qrwcYzbLQunlVOBu5Z831yE4uYkHzAuqnkRH182WS0a8gBBeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lRVLkza9qMNcPhrB18b2LoQz5dDWY/U+tXPuqEGM8dM=; b=aIomvK0RJugL5/hAyUmoZ/bIz0qkW62JWRVP74t0Yn4rWLJBmXl0JDSXIIMpFvxS4QreKKokgueyWK0qpJQL3LldKTW3lM08r14Ng7wYe8AV70qtyRS9OkZMoIJCfBR+1lquUWJx94AbSkohm8PEFB9paWm+IQVNwB7Tivdg8l0= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BN0PR10MB4856.namprd10.prod.outlook.com (2603:10b6:408:12b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Sun, 5 May 2024 17:05:12 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a%7]) with mapi id 15.20.7544.039; Sun, 5 May 2024 17:05:12 +0000 From: Drew Adams To: Philip Kaludercic , Juri Linkov Subject: RE: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Topic: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Index: AQHanwz1uP7OwQElcUG+493pm1jGCrGI3MEw Date: Sun, 5 May 2024 17:05:12 +0000 Message-ID: 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> In-Reply-To: <87plu05hcu.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|BN0PR10MB4856:EE_ x-ms-office365-filtering-correlation-id: ec8a8e35-5a08-435f-4c98-08dc6d2586dd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?XfYEkA611gV3PkfcT0x1f9yyk3aMj15n2gM5rdzuzFPFjkQCPNEecyTfCVrC?= =?us-ascii?Q?fYEWjbPocwtX4fuOGR1d5UKSR3oLKesCzxEEgCuW/Om68POpTrOqulzhdcZV?= =?us-ascii?Q?F8lyAXYSbnElFNkv7XYffWpJFJUVyej/dz0bxTRChexWu+1P8hyOmGfGN13l?= =?us-ascii?Q?taWW+5wrQszQ5/V9i9yRkebYN3qfjUjj5WypzkD3HvqW/JxrwLys0ONcnGSm?= =?us-ascii?Q?YAZLEyqRXm52zTln9KT9JibUptKBI3qg/Y/m4otGGfelLnUkaQnJxaKmY/XN?= =?us-ascii?Q?dHaywSG+VMyoiHG3NtDiGeVYq/ZXTEkjkyxwMZpXCQUuAyqspMB9htEbh672?= =?us-ascii?Q?QH5dBzVUwrKE5cD+25DNhcQEylv1MYnYa3fKFDNlEvVxUEz2iDib+1g3oMeT?= =?us-ascii?Q?HezD6Vtrm1MrJf4z33ogBGrxOUm43c2B1kiWoQst/Xfeu6uBNA2Hb0G4pEnr?= =?us-ascii?Q?3UUsl9eldnt+EGXAj6cG1f0h0m6gp3YDFXGENPZiulTNIsKWkPH9a6BvwefT?= =?us-ascii?Q?MD+Thx3HAeqV8F03IPjq0lufMKjvGP7jx7x1iEieKeXDxDOaO8QGIlD377YG?= =?us-ascii?Q?GbNN+r2ztbRmX3WN8foeEw2a4x4kLOD94e7DPLSdN4HK+boBjxoa3wHBQnSY?= =?us-ascii?Q?OuJc9QOfxJZg7NAw0OFpjeAkToRYgsR/jxs/KfHuZuZJRysTDUP4pPLXICOi?= =?us-ascii?Q?bLDSvMLEUoObddPG3xIBgNakuq/agshaTiGSun1M+32ONp0lZ9/U6ZOd1Srk?= =?us-ascii?Q?rl3SxnpeApQP3VgkJFNNDzE7kW59fE5XKwkSrNRUFeM+zdLluzITbos71+TC?= =?us-ascii?Q?Yntr+U7yTpecI2pJpCVHkEU+kIiSfRmXENwQgzxsZp3wRNblz/7ytz/9hkoR?= =?us-ascii?Q?sg0ciKNVPxm0FqReZjwXzCYgWp1o1ShQQUhwloeJxHHJP0gPkKl85wXdTnCe?= =?us-ascii?Q?6D+ynMaoteSjMeoTGRvZ12+a+UBsPGmRMb4Bdasfr1kU3vA+MB/D24BRShPY?= =?us-ascii?Q?7B4BXvQOXSgnDdsFvIsr9n2u+clrIF/2ERpNyAB9vkPwtKRqx3pyhbzdQE0s?= =?us-ascii?Q?UE7lFNO0K8k1qc+s8nIywVx0L9MyE4XRU33Xz9PRTbk9oNlVMKt0KXhGa5+M?= =?us-ascii?Q?seegTrNfPB4NDJBB+Xw1a58IQjdpH/5ZYwQla2f981yLY2oYkzngd+cmFQk9?= =?us-ascii?Q?VgvjDd/XcSjifwbeJeGSzCgGRb8ZTu4xLv32TdDu3N0C13uYMxdScVi2GAAt?= =?us-ascii?Q?koh9DwtLVXxkRxz+gYQCasBEwpWNvf3EnxXALHZ1nRgVcDluIF22v+wkdPTc?= =?us-ascii?Q?S9NEofKCTvnmd5AEXeihOcqZTshQ9VLvK3asHTVfWU9/mw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WztCyjJ6atBX9TEGsp032JlFcBrCMUIsE2rOyY+EE9WuwpRXNJc7FypklGD2?= =?us-ascii?Q?+3LEgbdcptFTI6bRcZN2lqLwZxZUArRfgNBdht0qUeg57XcgxNwSvQ9grG6f?= =?us-ascii?Q?BbJtN44A440RuUXYk9JuQI18+RyqXB4TjgGWDHn55QTah/hnBGJYZlqwczQw?= =?us-ascii?Q?csfCxsiz9zmVcuFZb0KsImVWceLH61GnruuEGoyH6Y1bFCqxmFbsNr7xQac7?= =?us-ascii?Q?TaHPkhRfVYpsmD9ZoNOFys5+UBolRiuaUfZKo01PvXfalOidwzeDkXkA8ctM?= =?us-ascii?Q?UsQ+G0kdYjJjefetET+R64m+OWJtd2neAlwm43auALUcB+GsCntKJXFcvPq9?= =?us-ascii?Q?BApCHS01Mb49Y2QVR+Vm6LB26RPcI3rzhFD3ftmob2VexaYTqyAf+ywDpJyv?= =?us-ascii?Q?luDse7SWwjglHNN8MAPCtffWloR1xV727dQuEoHrvaw4lPZb0jjvnF5uLhmb?= =?us-ascii?Q?F92ZaXUBWIm+wdgCY9nxyrTkB6lSBPYwIocqW3GK/ny+Q4M9ZTwR3Sdalvlr?= =?us-ascii?Q?HH/qRZ6Q+WRVyzZHbM1G8jN6Fp3m1Bsi9ZnbDmD5DClsC0simy2viC3hNKXf?= =?us-ascii?Q?2sfpVS5u9MbQqUPg5RakZoQnWR5Y6JuL7sDHb0S7jbJX2ckVJK6g5vgDO/ih?= =?us-ascii?Q?1fKLaoV0HAoJwCN+BCyWSUV1I5mp80vePrlSo6/OCk3xtB0934q5I2O41hr2?= =?us-ascii?Q?AmtOtlVtRpITqm7cFUS6cUZLBVY3zjl/D3Htz5Nr8y1Bl6NoxORPhJ+z/SqH?= =?us-ascii?Q?wUPuvuSeccRi5pW3ESZ3lVyipaOEv8pCnuHRq1/LW132MchaAVc/Q7xNg5/s?= =?us-ascii?Q?ZNviXOxdkONblS0Qgd2ImRCJrpSQPm/eGWohj5uBTu0hLHF6l+Cr7Yg6Cz2T?= =?us-ascii?Q?LAUwSbphhcLQHyKZOdtZwXFv56y6i1dLz4vt5kxYI6yQjC4K87Ibb9km4AKV?= =?us-ascii?Q?fTQy9X7zjnN8fZMWwOgJyvcRGeDTdVOFQijSLjKvKXA6pAc+vcxVUSHcnrrr?= =?us-ascii?Q?q7fu+chCVjeUrPKuEpaeVfd2CwoDhcOWBUMsB44uA3TZDkj+NVyhx03wZt3d?= =?us-ascii?Q?cBgm9kyNQjhRErD22nA54tl2ZcCvfa6RbFJoFXhSMUr/jBIarwbSWQKHNmwk?= =?us-ascii?Q?eWXSxX7QRBxhP1murfeFlp5GYxBWzn7PeVetfivDjuqvwFuWxluQtquhMCPL?= =?us-ascii?Q?Z483cSlvEHeTosh0rwP/MPiqxOx/dO6cjS/KARrT1ksb1V5AwtMSnOxErA3k?= =?us-ascii?Q?YgArKOHBuqKVNIrzb73t/6h56jX8lWnouRfll9Yhr+B57y07aIbUgnZc3ZGI?= =?us-ascii?Q?FA5aattCv++7/KGFGMpt+DRIvx2XxXMv/QS18ZYLoNLCZEMEM1DHzdeJu1+u?= =?us-ascii?Q?GfhzIW44IzCxqxQH5MzfZ+dC5I0Sf5kMfDF/es+3IP1CEUPSx68lCB4AH5P+?= =?us-ascii?Q?y/IHdQ33qBmpk/zzd3wVgq45NqEMz0P000u396kE+nuR9OEG6BD3Kdxy8xg7?= =?us-ascii?Q?4VoU/4/+ZbJt+bpIJEOy6mXjF3fD1k461xWilWefbBjP9q2TCyhoPQHk6Q?= =?us-ascii?Q?=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: vcIz+LRPjYF0PglNNS5eFQvpjvcTk9YmJP0rgTVu+PGY9qkPNZlYlJFoivqFHevmyyvozQnZrDFiceLQexGIjo4zNWvESvnnRgulU9rtaArGXxMWUDWaLOte9mt61uitWO+MQjNi9+nolJxQvlscTHc6MMUpUw86iVi+x8wMnV4/vzNtWYes9YGKCJYgMt1SEdQlXePz1dZBlkSjqKJUIIiLqcFrNC42zFbrz/COS8X7IaKybH1/WkjpjY+zFKdQ4iGCMeiKS4yntepIlSH51ojMX4aZYXFFB+e9X9kQJjCvGnIyZl2PSGDDq8jeeGgqr+GKaC90Wy9Ggpe/KRa0tTfbUhFysm1BR4dhFIq3l7lRIcRU//3k7sb+2QaPztq4L4+xhYgP12NeUJR5UxDB68Nyyoa617l8GM+Bq6gbcrmI69hVU31dSXaeXin/Zzav9xl0rDGggDwL2visiaRS80qFgGQLB9oB2KZqHv86H82VImiQCSp2AIOZCL1IMy+mYqg53v/n86Fi4WjZfXfoQcDO2wcbS+YADdlSw3TuKV7KR8lUUH4VFwtj9KVHrkKp2zsGvi7OtwQGdhQs7up3fkVRWvrgLjYc4VK6N6FFXiI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec8a8e35-5a08-435f-4c98-08dc6d2586dd X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2024 17:05:12.3167 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Tl0A/jEVZJazYQYw29yVKJYuOdKarGjL3UkcldrgJ5zmCqED2lpVRhfsHboJLdQOyeKEXMnkDT0JJa0YUoRV4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB4856 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-05_11,2024-05-03_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=940 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405050075 X-Proofpoint-GUID: tLEGYodN5mjVvB5FyqwrHE5GKcGmFwi2 X-Proofpoint-ORIG-GUID: tLEGYodN5mjVvB5FyqwrHE5GKcGmFwi2 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , "rms@gnu.org" , "69097@debbugs.gnu.org" <69097@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Right, the initial command just merges `backward-kill-word' and > `kill-region' into one. `kill-region-or-backward-word', then. And the open question then should be whether to bind that new command to C-w _by default_. (My vote: no.) If you like, just suggest to users, somewhere, to start using that binding. See if its use becomes popular, THEN revisit the question here of giving it `kill-region's longstanding default binding. Just one opinion. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 13:09:09 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 17:09:10 +0000 Received: from localhost ([127.0.0.1]:60755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fML-0001s7-Iu for submit@debbugs.gnu.org; Sun, 05 May 2024 13:09:09 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:38224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fMH-0001s1-7T for 69097@debbugs.gnu.org; Sun, 05 May 2024 13:09:08 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44570FBs019883; Sun, 5 May 2024 17:08:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=eTFRTDhpQa5buSPyFyP94jqi77GQ0SOvjwD9z4WA7BI=; b=JYecYKMfXBarG6JUjL4gKc/l1grJ72Jq6IEWVcVADqnPS1qIArn/fgVHUNGNgXXpSSRp 58e0oe0KXA/yTspRGG/1NKAzdnplkLnS0q3nwGzIjUA5ErgKFiHIF0RYoadXFzbj6lnB B0I3gWPHgx+mVLTY6dcNzup4ZXhkTya2T8C0/3xHGaqTKSdoiLXVrYW1zHyEC+aovStW fCc3r1J5Hojbl5b/nl7BAZCWh3dF8/k9vFJZX0c4VXhWwNXsy7MHGuD+tIyQWotOq2X2 pEBIvP+Bu7wnZH67xViJEAl1No1f5MeLA6CgKDyAo2Lpdoi3mSFJXmNJw2oXpkiiF/KI 4g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xwcwbsd08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 17:08:39 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 445CVFkN006924; Sun, 5 May 2024 17:08:38 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xwbf5syb1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 17:08:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zo0xm2nvFil8/IwVL1yv6Turkoc+n7u5DQHkjTiEYTM9IZtGyGy3P1/xPbyiJD/xJiTYvxdWpVHWQR0j9yLzZk6uOjy2EQMmDUiFXNlBhpVABRzkmzlFcsDoOK/gpFS0pF8DobwyzWEViC2f24er6S6/lQma+QAPKvZcV1QWMalwR0pdYQzJOZbJLWxPfLB9uL/5boGF87tGelxIoMPcFp13KpQdvSIW0kSoqc3obQRT+jYJz/FLZm2e9rZup0LJT+0PbUuNKCRNR+bUBLWJz+VzBc04sjvhknctd8UHPXJPAhsIRRPNNRDgE4uWXZOI22ReKaEkxY9sPH84HF8dNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eTFRTDhpQa5buSPyFyP94jqi77GQ0SOvjwD9z4WA7BI=; b=fG/ejZkiXYQLcwj+I98NBMasRV7yLIgSNcnFF9pLdLYDT/MWTD2jRN9iWUBWi/xSv4qhbgePfIYteu4z52wnfu1CnLM/dZnbrkphyaXo309ahvYnTAolQ/wtYX0yOqoQqM0ErOOW0PmjZDfdWwKAKvM4cvMLcHV+vzX+QpBXafBsuO2f7YmO+GM9xH7jnBVFjW3OHoCnnIeGF8J6m4PQ8OAG46EZODT5z5TMEsKY4LEBLBamnTx6S+9y3sEm/WnkqXFal76+QX8T0F/ioc6b2cB5RF5+cQrxidoPT3ewDctXP1jcEDoDmXu8JECK4vsFW+cUxYl6X/wT0zLG4hHE9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eTFRTDhpQa5buSPyFyP94jqi77GQ0SOvjwD9z4WA7BI=; b=MDp7+Su+xlVb4nRNKzDT+Qgw/Zlap9U7eIN/5r5wgl8TodNw1w97Mzt5Zxa7xlbYJyibTFlDl+WDklK4dLM0lOUqRKjqpn8n2NTMQRJkVKajvrttyORKNyIgBfIXqOsPrMK2YXIw6iCeDnCtefduQJp/Xjf48lteEbITFOc6HHk= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BN0PR10MB4856.namprd10.prod.outlook.com (2603:10b6:408:12b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Sun, 5 May 2024 17:08:36 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a%7]) with mapi id 15.20.7544.039; Sun, 5 May 2024 17:08:36 +0000 From: Drew Adams To: Juri Linkov , Philip Kaludercic Subject: RE: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Topic: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Index: AQHanw2huP7OwQElcUG+493pm1jGCrGI3s/Q Date: Sun, 5 May 2024 17:08:36 +0000 Message-ID: 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> <86jzk8i48t.fsf@mail.linkov.net> In-Reply-To: <86jzk8i48t.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|BN0PR10MB4856:EE_ x-ms-office365-filtering-correlation-id: 27282eb8-0b15-4ce5-86d2-08dc6d260096 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?DA6dBiLD6zfa2nGJlyCAiqAhUEEgX5CXanBlJcxDewHD0iKx9PQdwvkcu9wV?= =?us-ascii?Q?bTDbCZvs9rbU0jSo4Qoc944dAxVSHchyRxjs8Rb1rDK4f/1Cj4gHwvoaVaiu?= =?us-ascii?Q?hLoN22PQqDlN5jjhtfSEgpHffiuPrWS5uM2K0Rhp+K0l7t/sxEjFStRfTZ11?= =?us-ascii?Q?8PQGeJJAtN9qSAWBOs55znXMp4jLqrK8y2S5zFFjXGwcUrl2g1VBqYZJJXHn?= =?us-ascii?Q?9VlgNaRfzvZlIiDNSwxxt8MjN2mG0nPLiZhLZ+5jqcD5ufXeEwPcGdyUvXlO?= =?us-ascii?Q?nrN0BJtalauIOPoHYrqj01jKwAMIIqlpd1ev/+/XYEITdvGUJlHA6TteEJOY?= =?us-ascii?Q?Q16XZr2+Xycp8frJgp4BrOg2bC0gCGYl8Qs+aTj56vKl/y2aCVZg9Joh4d59?= =?us-ascii?Q?cbJbdCXNNNtZsmQaOSSXDFXURT3M7YY66xP6IqZCkUcNEzx+7Qr0gDWeBUwC?= =?us-ascii?Q?o6dbaMdGGANgqVhFECdAFM9kvQb4hBiYPJIhTl+lUfCwE1ZsWBEPAFxjZmRn?= =?us-ascii?Q?D5nx+PPQjYXI1ZPPfcmRGZMQLWL2HDLLO5Y38vLxfB6OSiEidEbtBEPBdwei?= =?us-ascii?Q?pDJQxKXW8iN2+OkOe69vrcVM1EQeYbunH9JAvS4zkpeYKzXSU2q14c4BV5RA?= =?us-ascii?Q?R1jBYTGT6mUAJcoAc+WtJHrIt4inlIFjYetGSojbaCvMVChsLQMLbPVNFiqJ?= =?us-ascii?Q?5ajunAZQSNJSmnuwS7PyZK3WvchzVWO/l7HEhL8dUvGRcyLDS/QgTq4/CpsF?= =?us-ascii?Q?KQBbxnCHI+/nkeUS6ZduuGwZ2k8c8pxQiDnc5SwPMqXqUrqSrZSJLbk2Gl9h?= =?us-ascii?Q?2u9zCvLsyt7BegMvIMXfXiQqhLTNLJrnEYRQ0bA6Rve8Ks6r99Iajeobf9uI?= =?us-ascii?Q?fKPeWUq1loKqbT55iWlfkNgs/PxSF3GAKb5P2W5jf8VIzFcHx8xHbf9dJRuW?= =?us-ascii?Q?u/znZxpfXKxFErH+RrFuTmR3yAA/WPr5KsrDiNE05x24lKSf4U0c/hh+9hx9?= =?us-ascii?Q?SemxzZFer2Z94e8U4xeASAFddCtZWBvOg6ValfrtnqrLpg9gKcK/6jff3qYW?= =?us-ascii?Q?Y0pRhGsMq17dLQs/L/GHuM+vwbxyQpjaQ2TVt3PEYKuBeLxFvj4MtnYijVcu?= =?us-ascii?Q?m+l6dw/81LR2YXf+W29yk9hlg+DSFq9U8kN25pAfBD69zmX90Rjmv3KQH8RB?= =?us-ascii?Q?+KtF6tSxrXmLoqCvVKrxC1zrAMMALHnTY4sRYW1+o9O2jFVzMArBuSh4hnjM?= =?us-ascii?Q?NWoYm1kzAV9MexGXpaZBAE9/5A/A20LvED3eT9wm1dX4/OfI93v1sgkJcMFg?= =?us-ascii?Q?z1p2e9NAXCCv8dc0TCP3XAe7c0TGks2Nk6GG9kjCRlDVQg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?29kPGcLvu4A6NGxL0GK6KucG/cvbkroyMs7Y1h6WA2gn9W3nrEM5PUgYLEnz?= =?us-ascii?Q?n32u482Wgz0QPUtQLRklv9cZ0XpjFoYfGV07BSKdBQ220+w91l2TYhXsIwvZ?= =?us-ascii?Q?K2zl0Il4+MQ2HEXAb131vNo8TVFTaNinti53cqyc45SMzOkZd1qKvfPQCZCm?= =?us-ascii?Q?zBD+bxJb5CaffE3mrt//uOBAkWTIVQsZI4P3tdgQZRLBRh7hw5YDD9DmXCVu?= =?us-ascii?Q?jpzW13Yds33k4fAwrTrcK+uAT43UHo1YR4cFdlAIBLgCeW5fIOPFJSc0yA1N?= =?us-ascii?Q?czOaNd6O80agPi8Y6RvvWfjh4mqSA0z/JyeE5pE4e6H85cDF2gyVS/+tvO6c?= =?us-ascii?Q?Vxj62iGxQf0mzaaw+oObT+zEvlllOslWtNA5FHCfOGFKcObYZ/XRs/YE0cfI?= =?us-ascii?Q?WUqo40wgP7rhdgbtLyfKqCtfN5EaEq3K076bkXqewMFO93LdxIchjfIcbTdo?= =?us-ascii?Q?zXiRqzQTqirGaQfYrKi+IutXF6l6mlbRAZfLLna8UlP0933Fa9SY//n+Vn01?= =?us-ascii?Q?kWg/hjoierwmhJpC6R9H+S/fZkUUCfH5Mw6q2+2GXH+WFFN7b4UJg8Y24lVM?= =?us-ascii?Q?BSmoIyGnXTySou5oJ61YAW6/wTO+bGqa0TY11uxyUPvc9WJYoAw249rBOVIJ?= =?us-ascii?Q?A8Xt5ptWpEvs1/pT+1uZY/PznlrSYnZUOMa7VG3P+TZUDB1eIzIoI2PqtimK?= =?us-ascii?Q?hJOhXPpdhIeL1F1LT991oOSv/zTCbPZXOrFS1BPh5WZpjeT4fyvjTlhe+PeB?= =?us-ascii?Q?ZUimTBWwormp+/fHjMrhaTJMpV4/513adO2sclezwlKN4DiA0BBsBfcCP2UU?= =?us-ascii?Q?2cTZptEpoCFnxjkxulrjkSpBNVUsa1QQF49gQxkxu9ScoY2QwI7zA0h6sgxK?= =?us-ascii?Q?ecctDU3HUBb5wvv6TzPUxQx42Ym99BYCrno2CnM/mkz+0BL3pp9njC5DyK3J?= =?us-ascii?Q?wzcaeDifWO/dqS9EYdc5Gn3Tf/oWPcKXghNSfmzlOwmCPP06zLS8uafwM3ex?= =?us-ascii?Q?O5dVdWVmXxQV9txNce0ycntaVOk8QD9vxkDLyr2rgzM5ko/wndw5wJWGEpyx?= =?us-ascii?Q?yT4gGbUTa60hMHFA27Onuk3aQeaCqQaHNpyeZCCkXrlxcWZUOd6mJ2uHEFbc?= =?us-ascii?Q?WBhQOWQs4i5zmf3BTD9HqV67mtMLb68XNl+P3y+y/6QuNQThBRVtH/2jAxts?= =?us-ascii?Q?MiytyiM2zHwPYZajVYm1CArgeo/Mc7q8R5W1tPyrmVxVgb2tU4nHbvNsXS5S?= =?us-ascii?Q?XTuOfoOAZYqgVf7yIaZUVUDUfMIANrGJXodmZjhZcGO8Q8cKuxoyG9MeloN7?= =?us-ascii?Q?Sa3mi/mB/U5BbfGXKxx/+H9Msq1fvajTRuiYpHPU+fl0rc5N8sMGZo+NQO1i?= =?us-ascii?Q?UDQ3u/W5XTJfOGJ3TPaeJf5soJAcLrzeja6diSkMiYc5/8zF3jlhatFvf7J9?= =?us-ascii?Q?X/qmSHqxHa6TQM6cg0iAHXBkooGfZccmVIVeBER2kgGpdneDwZ4+j/5cdFIf?= =?us-ascii?Q?XRG4nmfpO2Xg1maL0Q5pEKmMH6hgPNmCYOmm+LLAdOXuvP6/PlO8AqTZSQ?= =?us-ascii?Q?=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: eCuAvByGV3fLGCOrnI2h2hVkcRhSQYDkbiuFOvHioX1GbyzpFwbAFg90yXjB9x6/oFlTtafIaGTc4SzLwKkG3Fzvil/aNKsio56svDEscUC1fx4jYjaHOV0oX6WhI7u6GM9nYPVN1H/OCogPrxJ+OGO+DF6dHbzCao/oOrzV2ZltMCgA3uvlj/Pr7F043MaJk2pgiGaTYP9Y5UinzV4sHwHAB6MOr6WnHZlEtUUwcX1oX2MPmOhez4VbkVxqrqkcTmjLeF9+k+TQPL8hFXiBN7F3xkZg93Z92z3X26jdTq2QsI5wxQalcHHT4WBLdLPcGfEbFB/DGVY+r2axjl//ELIiAgDYiP3CEjb6jTSzMptLjiyu7a1JMyHkqH7Vj6yG+hbCShxrKodiYjbh/7aYVVS6APJWje6S+UDiJj5K7cOjbvpPtCNAdO558+QpwQ+zRgB/9aROUPnbNKWkpIEKtpCQWidOFGvomI9kGQSavFP229Qzqv1xLqaBJRx2TXwgmS8Bh5vcBj/XiqWf30zljPMljQFBYxyJHuxYozaAGdyhKp+BM0qPOLRl9Q4+hLeDHFtHXfe404/UIcPMdCTcekvQXAAkiKf+6RAQ54KY9lQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27282eb8-0b15-4ce5-86d2-08dc6d260096 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2024 17:08:36.5567 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rMqoVPaPJ0Nx52gl3TMhZTYDUri5CK5tSokZJ0cKZM1aB9/w1L1KzP7/LTaM1apGWJjzlvduvfDJ0dtdd5rspA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB4856 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-05_11,2024-05-03_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=777 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405050075 X-Proofpoint-GUID: D8xL5941d-oI34a45OjWKVgSOqZnsM5U X-Proofpoint-ORIG-GUID: D8xL5941d-oI34a45OjWKVgSOqZnsM5U X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , "rms@gnu.org" , "69097@debbugs.gnu.org" <69097@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Right, the initial command just merges `backward-kill-word' and > > `kill-region' into one. >=20 > There are two ways to merge: > 1. `backward-kill-word' into `kill-region' > 2. `kill-region' into `backward-kill-word' >=20 > I don't know why prefer one over another. Just please make the merge a _new_ command, and don't give it the longstanding key for either `kill-region' or `backward-kill-word'. Don't give it any key binding by default. That's the Emacs way, IMO. If people tend to bind it to some normally-taken key, such as `C-w' or `M-DEL' THEN raise the question of whether Emacs should change that binding by default. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 13:14:41 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 17:14:41 +0000 Received: from localhost ([127.0.0.1]:60791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fRh-0001vQ-H0 for submit@debbugs.gnu.org; Sun, 05 May 2024 13:14:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3fRf-0001vD-Ag for 69097@debbugs.gnu.org; Sun, 05 May 2024 13:14:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3fRB-0005ac-Ce; Sun, 05 May 2024 13:14:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b+vn3LjeyJvszS45R7ozAVoiH0RSqWBSbSqppGr6IPc=; b=LDhll9+LPATG dGLgPOnZDMFAfr8yEXwIgquL2s9/DQlFthwjA7LicLYuebP8FREnzfiO+1j23o2UPI+lnXH5dTLgn qLiHssFPDIbaS6vaHx0I8qCUPsnkbAVnC4pY/dMotDfPkP+pWiX8WOXFwhL6Qsv0ampyqxzHMSXuV DOFamextQ740sKcTRQk4rWC4N48n0cv1ENWXPTtfQSNNFMnBSC7njL6rJSMlwW/9gygOqrJvWz4CY iCu4YVNehZDzQwJ2Ns6Qn3jOa9VHNXV57c88/azIrXMxPdHA7kuhJCgMP/KxWRt5vC6AuF/UwoL+B bbMjDUWUAPjup+g+WbBISA==; Date: Sun, 05 May 2024 20:13:39 +0300 Message-Id: <86h6fcchbw.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-Reply-To: (message from Drew Adams on Sun, 5 May 2024 17:05:12 +0000) Subject: Re: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Drew Adams > CC: Eli Zaretskii , "rms@gnu.org" , > "69097@debbugs.gnu.org" <69097@debbugs.gnu.org> > Date: Sun, 5 May 2024 17:05:12 +0000 > > > Right, the initial command just merges `backward-kill-word' and > > `kill-region' into one. > > `kill-region-or-backward-word', then. And the > open question then should be whether to bind that > new command to C-w _by default_. (My vote: no.) > > If you like, just suggest to users, somewhere, to > start using that binding. See if its use becomes > popular, THEN revisit the question here of giving > it `kill-region's longstanding default binding. > > Just one opinion. Did you notice that this behavior is off by default? From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 13:54:18 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 17:54:18 +0000 Received: from localhost ([127.0.0.1]:32775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3g42-0002J4-3A for submit@debbugs.gnu.org; Sun, 05 May 2024 13:54:18 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:12386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3g3y-0002Iy-Gv for 69097@debbugs.gnu.org; Sun, 05 May 2024 13:54:17 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 445H9WA1021809; Sun, 5 May 2024 17:53:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=27ruiYf9fzdewUg38vxP/GxyTw/2Xck1nmkjdKr1vYU=; b=E6Q0rP+whXEz9ioC6KTTXPmD8BGaTIFvDsx+S77qkQJRvZLQ6JlnOeJLXzDVkWNyp1X8 AwexjsVbwYkyl2AyjjpWrgPPWC3/VuGyJ5hNRASBClRcDq3NGcprvwAl28egUD2e1uu/ ibqrboiJ6FyPClKsjQx4DCGlLb8gIFuYO+SSGDugx1WAtXu/uRYc5asj/tIRkIzKP9bf uY39ur3YUtiVYzdtUxQ7f2tfyc/AmHlmogd0liemqpUA1wFRFZym0gVuCAXtU7dyapph iACP9Rwdvb65phCdr8PHlcVYSnfRFnNbe4OpmKaNNr/KyxwpdswB5ALiJFGhY1suKe9S 3Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xwd2dscrh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 17:53:49 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 445Dc4Bb014070; Sun, 5 May 2024 17:53:48 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xwbf5407s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 May 2024 17:53:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yd8nINDuD1IL5du2hcVI1l37IZiNM7w3uJpn+xO0556fXNlgqDZe+VxHqXu/hc1RFkp//WcNCMr/RTWPOOScADSH3QGxjGu1mI6C3CT+Nb01/GdmG1KAp+JhQnozg/PlPEfB8RnTfVZKqjIdBzWni0nAm1KUQ5pZsZJ4oPCIXNNwzc0AAwUanwX3oc9KcHtUqwcizdNpFR8ej9GxemTZqE7ovsZYursNrem4dvNfaNt/G30U8JiGTqIH0g9vUCHST1ZX2NIWU9Cxl2RTtSalx+d/ntWx2WQAn7qkKOCZn2qzIBR2nS7TWkTvGmf9zjIi5JQgvGORTftXtrTjLo3j7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=27ruiYf9fzdewUg38vxP/GxyTw/2Xck1nmkjdKr1vYU=; b=GPzKRmaQFL7bFD3VxowxJkFKroqntElhFGNE2NO/fR6wNIWfssNZymkNwYdvQviP4q4boHPY4M/1dTFBqVxnseupLrqT0o3uQlsvj8QQd/i8MAKH8K5W5nv7mQF/svHZkQZTO52IPFVAnMb9Hhm5QY416E/bFnKlTNv3/W7ajrPQ5WhFdRU8U1rg8+arXXzsVPJ3S4JqKcRqyhFSZSnRXgfC5uIDtRZalm9nZg4fnnZezQt3ETQFGvG/vj7a39cbMUmsWwrq7sTbkLN0E0gubza8OHCRVz6hXiTez6orRi2fhFXG4ZYCrHFfFUKZdHgdIr7fyADKYcWEB5/LzqN4wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=27ruiYf9fzdewUg38vxP/GxyTw/2Xck1nmkjdKr1vYU=; b=K32ghHBkHVmKzeAoRfU6xvCQnyWv9Yl6w+9aSldxFIFPfmNIk3xRhGqBvRUaTs63yGTi6omgGthjhsKSUx0aG7pIazCKnB1aIJ/mpe9GBcDQMzI254Eqp+GJP/yKictl3v9V9zCBwTYqvJ9iTgokhok3XCCewq+2mA2m2DBgY24= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by DS0PR10MB7510.namprd10.prod.outlook.com (2603:10b6:8:166::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Sun, 5 May 2024 17:53:46 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::380d:4e6d:faae:a72a%7]) with mapi id 15.20.7544.039; Sun, 5 May 2024 17:53:46 +0000 From: Drew Adams To: Eli Zaretskii Subject: RE: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Topic: [External] : bug#69097: [PATCH] Add 'kill-region-or-word' command Thread-Index: AQHanw+SuP7OwQElcUG+493pm1jGCrGI6+rQ Date: Sun, 5 May 2024 17:53:46 +0000 Message-ID: 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> <86h6fcchbw.fsf@gnu.org> In-Reply-To: <86h6fcchbw.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|DS0PR10MB7510:EE_ x-ms-office365-filtering-correlation-id: 490b5e2e-ab71-4a3a-6719-08dc6d2c4f9f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?9QdI8B3bSj4Bh+zMChQWBZJzerZkjh2G6txFaL16eTKoT8sx0XgdYgZPeSKs?= =?us-ascii?Q?htZeWkLQfrppjXX+3eJx05ZsHdVWQGmDlbd+3k12GQEFx7ITRKzX1v7++L3g?= =?us-ascii?Q?8kajUzhuMrYy7HnBr3mSLmwSPD3PEBgop+ctlHJA7aOV/lWDxEKys/aLftAM?= =?us-ascii?Q?iPycM4y8MoXWQg6MthR7I/LWM1+pefkjnfLs658YKxdVYU06+B/NbA2Adyn7?= =?us-ascii?Q?Qqce4Vu1bNn4rxMXyztcDclfes2wjlK8bsGlqS+/XmxRms8qCaoiv/hWjSQf?= =?us-ascii?Q?ZUNvSOEwrtQUqGYXKvRkFkD3KIKeDi4MP/lNy/4Km+w+5/+vr9k++ERCog5s?= =?us-ascii?Q?I6YjMvfRYB3VsZelnlGvuzZWtS9ljU1nYreUwn+eY59+xOxrl79BN8EIaCEg?= =?us-ascii?Q?SyBv3csY/MFzlvXchyu3G/Km4V9lMkIfkdaddJOpzfl8237P4zUseRGFTFaK?= =?us-ascii?Q?4tv15p4GSiXLM2yhqs9gfMScXvrbBYoPFQ9cC8y0bd0LrNxRYOP0IEs3rvSP?= =?us-ascii?Q?oKkyNd0kLlED8/YJVSwyrhnZRlgAwzYV5DnxQ8A8Hwhp9EEX8GdEs9yo/Nsf?= =?us-ascii?Q?Raq+TIgFjc4eFaujKxVv/M1q6mdLKMZi0zu1916icG9eRIz2ti9JGO7XzCUP?= =?us-ascii?Q?ahnHDBM+tRPXvxOC6EYeWgrrJNq92Z4XolUgQoes76dskTw89IQZr5bmNHFm?= =?us-ascii?Q?KzUEfSXXEIWDRIvyBCFpF/mFMZpfBee1QUaL5/YFjiobe1cTbwZv8gE5kfAI?= =?us-ascii?Q?P7dQH8w2Ct/1HZaOC2es9ePLo+KFBmFg3eu3qQ3sEKQt5tuKkuP8FzcLsXvZ?= =?us-ascii?Q?dqjAqUyZCKwEBGRnSP74KfnGKg2RS46JgWywX5DWzTSueJfX+PdT9gs1t09H?= =?us-ascii?Q?nlzBGgvZnorOlZPLItmTFS/xeJz4eD60Jd/irde1pJprHWRJvt4OCMfgQT7P?= =?us-ascii?Q?1zjUc0Dy5eIRJvOcS2WOKgWqt1cWclvUQedP6h8Q2cADEDH1g4Hsgrz9QTMn?= =?us-ascii?Q?HkVzgCGl3pztyy7J/VvfY3LulKcTYKgbgRxJPO5KJIedrwFS+KNN8I6PhjsS?= =?us-ascii?Q?944YCM+fbTbXjRQc7vlWVr6s5JvaYJGZsKJ4Q5Xym74ib+nbhpv6sgKojoAU?= =?us-ascii?Q?57KnJZn2WYQ+BBS5+hYyX6cF08GFV5LlRWkgHiP0O3a0itNybOABtSx11u5m?= =?us-ascii?Q?nMzkafEOrq+rY3uf7GPMManVODdYI2bdQYXhoMgmKY0qBTqB4Ojyo/X11Zo6?= =?us-ascii?Q?5KT1Ke2xPaeUFZ5emOWrFl+FV9idD1ijLISGrwLddQMclMvc8NDiO26nXLu4?= =?us-ascii?Q?icfzQbQZYI/I6jIqla03u1zn/CsKHaW+D1fs9bGqA8Qujg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tct/jHyYua5xE2SvE2Bb/GmT5r+WRUUzz7tV7E/4UdGLJh2lOucXozgSYG+f?= =?us-ascii?Q?myGkhKCHj1P1AQgIKgOGNQraJjezqFV5+u5lFkdAjEO6ZEVtet/7x8Cd+Bvc?= =?us-ascii?Q?QkhFJFkj56j5gFii87q3OOYUUzidw+zja+1bbT7D/uI2guNYbFCNS1ks6Klt?= =?us-ascii?Q?5n/+nu6C7Q+hyg24JQ0dDszkMzk6Hyz8FUO3F03cxhO33gskUL+r5NbRGe6l?= =?us-ascii?Q?6NxATxbxDEEE2Wy4a/P2mG2au5ye0Tkh1p6BkV4LYi1dyzPKxm+PoPxctq73?= =?us-ascii?Q?EE7g3XOyiRxDNCdfZRqp5fxIYB+/AlNGjiqSXJa5vSXiPqgESE+I0/scol9k?= =?us-ascii?Q?xlKD4hseAtcS95XwxBWYBM+JA03OxA025iI1Zo7es8tc30kTM1iRzyyEk0Z2?= =?us-ascii?Q?pFrbpUd2D8cSaUhtqspWQ4Dbf9XRH0GKciBxrjKRCJcTGQtXwngNqfp8hjn1?= =?us-ascii?Q?6AsNIITKQ43f8jLPtjwjr86TxOKso7upvLrnDgtqp5dHuOaWPhplHmmHZnt3?= =?us-ascii?Q?u7bKw+U0htHhmVpx7W9bwKRo9wjE828fvpqTUrgoTxjMsWF3mhT9HuyL6M7o?= =?us-ascii?Q?CHk6hgbO9Y2DNuK/9zzdJJFEXG6hoSJ+EkWHXS4EHc09X9UUjwCpQco/GwVd?= =?us-ascii?Q?N6MeH/NquY5OyMqtaMoJOpcPX0CaKiCzePb9rI5GF/oYOMRYWd1X28F2IhSu?= =?us-ascii?Q?qs+lOXQQx+66tQqVDqOd9U8MiCdu0ZDZ8SL3aDxyI4eI1jb980kjaGda6q7f?= =?us-ascii?Q?ewYhRHAwzDHKBgc2ipXpIQV50WWQ++pcDxfjk8AFmcoumCQkPS+s0cFnpjHc?= =?us-ascii?Q?T6EITJ6ubPU90i7eRc2vzT5FzU4RXWl3imdkDvRMAm59qvEU1VuN71b6fXCS?= =?us-ascii?Q?bLB75fYLjzdu/M4T4h3TgoOSvWZLq9NHT2G6TIBk0nM31nHcbE6+k/Zak41L?= =?us-ascii?Q?GyIJ3lmL2fKcE63OfsvsdgRjepT+GVy4zX41gc4hjugLxhUdXUx6qLkyXZVi?= =?us-ascii?Q?7AVi5VTSBnttPDbo4uEa9uTceLncUJUIQ1NGpQbjqKhPCfWcdSvy779xEUnQ?= =?us-ascii?Q?S00imJbG0aiUj8JvfzotrSNumeu62MRnL/ezAxx2i5sbnXMq8nOPQlw3QlTH?= =?us-ascii?Q?4UPjChgWFEixpEmLo+OuYKdet8HVrd6tfplcniij4cfam+vmAXRdVsYA7/Sc?= =?us-ascii?Q?k3ehdzSrp+7WLr6t0vmX+kblYZCW5zCY9HG0vTvU/z7W+LC1Z9gFbJkN1/c6?= =?us-ascii?Q?9iINWe1r7avfxd49a+lkMY3MURO4ZqT5XHr1C0OpxuH8+WDwFqSKXul4D+T9?= =?us-ascii?Q?R5+NDG+qi0pt/dCBs0jO7M0rt12/GpwSBxyo3jrAOCft0XUStfyJGawvuZ5j?= =?us-ascii?Q?CiQ1Qcd+zsAOnd5PNIS9NjTZ+5X/JKQlqknfjFxLRl/2rDGYuKe4s84bQc/N?= =?us-ascii?Q?SueodzAwHNJ26/x+XNcb+mxkDzm1ycATFuzK6bYySIKPnj4GnhH8BjOQEAfc?= =?us-ascii?Q?ossOEeUq9bwHGViTJJSEfLpRHmtLv0z25R6CIia/EgSpOeT6s5zMBabm36K+?= =?us-ascii?Q?xQgQu408ePioQXKSSHi1/q3k23+bFwfJKstmNqbL?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: G16sS+d6czD+sE5zuLm6455vsTHIi+UHnNKr9V3bKYCteCdxdqhkJauK83CCEJ782KiCr4yQ6jTu82kQTMyk6LHtlumSd/5SSweXGDnhmlehOkbNefXtPjPV3qico1O5g2GCXM9Hqahpgvzs5ybRrSTHWPSFSjoKZYZwSZ511ckjpLw/gduhx0FeYzqhSOCk7NTTEQe5muGWHJptbF7yXOWSzi/gBLVd40nSWqlbIi+x2+eQDNqKGfdQg5OBPhx+IAd3dZg3WXWXjdc/jegwY4U8s1PvZIaTa6M2Qt28pFhATHGEylzfXGizgDK0i/axqslWS75QyTdRdpypKhzWUbHiUvJJdlts80uqh/4nRoA6fP8nDri8nl1oxWwPwSddMh7kVUbONE3EI/r0bBTeFjBRPBHOQr6zy2T54c7x6WP/ptu5sw44CrNHjGUYEzZSPwxGF6NK0mX4Vcl4ihG8yfpKnQAvwoJ3X3ejssUPLUB9gsFT8oObqNgMRUg+YY6MTsL07LHh8yr4UiBRo+ncseA1jfz8J4DXof10lLSkug7xz8yUnl1nJvQK+BbKWcGmv3EmTcgQxiN3u9vaL64YGy//FirLJ24hl2k5UuXCh38= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 490b5e2e-ab71-4a3a-6719-08dc6d2c4f9f X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2024 17:53:46.1073 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VKxYQIGjPksFuvjo4d1qQ5R8CdNCKI9DHa14YAHVljonJCMVrX6mO5VrKbVXDLU8sX8B6A/3MjihKzchcw7p5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7510 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-05_12,2024-05-03_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxlogscore=910 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405050078 X-Proofpoint-GUID: SehvPAYfurG7E2UaLmsLpYmvTGPRmAQC X-Proofpoint-ORIG-GUID: SehvPAYfurG7E2UaLmsLpYmvTGPRmAQC X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: "philipk@posteo.net" , "rms@gnu.org" , "69097@debbugs.gnu.org" <69097@debbugs.gnu.org>, "juri@linkov.net" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Did you notice that this behavior is off by default? Good. From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 14:27:42 2024 Received: (at 69097) by debbugs.gnu.org; 5 May 2024 18:27:42 +0000 Received: from localhost ([127.0.0.1]:32923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3gaM-0002gX-CJ for submit@debbugs.gnu.org; Sun, 05 May 2024 14:27:42 -0400 Received: from mout02.posteo.de ([185.67.36.66]:51209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3gaI-0002gR-P8 for 69097@debbugs.gnu.org; Sun, 05 May 2024 14:27:41 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id F036E240101 for <69097@debbugs.gnu.org>; Sun, 5 May 2024 20:27:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714933629; bh=tzDLoSsseo9ZZBsir0cwSpcz+xQhIvCGT9YQx+z8XsE=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=nhTvVvJoz+1bEH2gbZbU9lAAanZggmtztC7LF21R9qQ59m5xTJDrUKYlh2u+9BOtD 9u24lMcLZLkeKWwrLYEJDh0sDcsKKj+tnGBGH7NNnKvcAxtywvWnHRrq78h+2jPp2v lyOvHos5lLA+zAerSCETFIhZNBVzCbU3E7h2U6qJNVGM2i5yd00qfRYXeukTO5LBDv MpalWk++F3VltkJnBrRPrxFkk8/1ZiNvwShZEb0am1947ZPmo0ruDKPYAlqKCoeiLh eaSZqvDNvkml3hTn3ZVzhtJz7e+2iwoGueBJjIJAAHl9+Wu+O6iBP2rmwvtbMyygqn dvFmPJBC3za+A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VXY0r1TXNz6txc; Sun, 5 May 2024 20:27:07 +0200 (CEST) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86jzk8i48t.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 05 May 2024 19:59:46 +0300") 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> <86jzk8i48t.fsf@mail.linkov.net> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Sun, 05 May 2024 18:27:07 +0000 Message-ID: <87le4o2jyc.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >>>>> > +(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' And 3. a separate command, like `kill-region-or-word' > I don't know why prefer one over another. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 20:22:52 2024 Received: (at 69097) by debbugs.gnu.org; 6 May 2024 00:22:53 +0000 Received: from localhost ([127.0.0.1]:34354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3m81-00016P-L2 for submit@debbugs.gnu.org; Sun, 05 May 2024 20:22:52 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:56076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3m7w-00016H-Qk for 69097@debbugs.gnu.org; Sun, 05 May 2024 20:22:48 -0400 DKIM-Signature: a=rsa-sha256; b=et2p9G5JuslMysHWtoLqH6MuQsfCNnphC9jkF/dl+y/WSwiQcAx3lMIhjwsZy2sRiBowqgrT6dRlGgMfsoTY+VEQW1mlyjztafqeh8cNMGofitt4ePi/QQ6Q8CITSukXQcolnF39aQIVgtYBuKJqED0hgPss2ylY0VfFCQrV4KSPLBHj6afZ8pLmhwN6e4wIUFvq2nB/LKFd3jYTtgOXAmx72wDGb2rtSeWOsMN0TKoP/W7H5tOs+zYdb242W0OlQxlggPdi7ZhXIDnnnsyINp9RcPblZSrO09DGjk03UVdUd1Bn/0ZSNsgvqkswIf5c/BBH75GXUmNDIfDDetPohA==; s=purelymail1; d=spwhitton.name; v=1; bh=mmIi1wCj25mmpWDADdHZqDZbI3PuwmSWrkGO4FUJy6g=; h=Received:From:Subject:To; DKIM-Signature: a=rsa-sha256; b=IXveq1KYovuPrpdHaZrC/6V9aICVQ6bng5qTDYRZcdTBNgMW3lFFwBHZuaPrgSMXAnLMABSidfP+Tk/d3UT1a4MFxU+QuPsFobuNdDK8hYVW6ujkZLqMU2Kpzmo/fHGyLDeX8oAJIYfVPxV0fE7yMI17MhBSkmsq+FQGZ8eB5kKojXioTRoL+KXQLJFBTeHVRcjDjvkrEJdJQt7XAejBDaUD4/hO1xFPM/E2Y5vtWKEbwW8lffwee858djQBwAzQwR6gnk9CJPukxRPuM5EMRvgJYGxAK0+AYioNKnvofCEGmzrwkmdfk1siON30m2sZjbBAVS+33I1Wd9sAj9r1ug==; s=purelymail1; d=purelymail.com; v=1; bh=mmIi1wCj25mmpWDADdHZqDZbI3PuwmSWrkGO4FUJy6g=; h=Feedback-ID:Received:From:Subject:To; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -183066484; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 06 May 2024 00:22:11 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Sean Whitton Mime-Version: 1.0 (1.0) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command Date: Mon, 6 May 2024 01:21:59 +0100 Message-Id: <1A1EDC83-2E69-4570-A7E4-2DAA64B9C6DB@spwhitton.name> References: <86zft4jl5d.fsf@mail.linkov.net> In-Reply-To: <86zft4jl5d.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: iPhone Mail (21E236) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) M-DEL and unix-word-rubout have different word boundaries though. I have bin= dings for both. --=20 Sean Whitton Please excuse top-posting and brevity. I am writing to you from a mobile pho= ne. > On 5 May 2024, at 17:45, Juri Linkov wrote: >=20 > =EF=BB=BF >>=20 >>>> +(defcustom kill-word-if-no-region nil >>>> + "Non-nil means that `kill-region' without a region will kill the las= t word." >>>> + :type 'boolean >>>> + :group 'killing) >>>=20 >>> 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 wor= d? >>> 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. >>=20 >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69097#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?). >=20 > So this is for Readline compatibility: >=20 > 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. >=20 > Then I have no opinion, since 'backward-kill-word' (C-, M-DEL).= > already does this just fine. >=20 >=20 >=20 From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 12:47:02 2024 Received: (at 69097) by debbugs.gnu.org; 6 May 2024 16:47:02 +0000 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 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 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) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 4D620947D9B; Mon, 6 May 2024 17:46:20 +0100 (BST) From: Sean Whitton To: Eli Zaretskii , Juri Linkov , philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86h6fceij2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 May 2024 12:04:49 +0300") 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> Date: Mon, 06 May 2024 17:46:20 +0100 Message-ID: <87edaeevmr.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 12:52:25 2024 Received: (at 69097) by debbugs.gnu.org; 6 May 2024 16:52:25 +0000 Received: from localhost ([127.0.0.1]:39064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s41Zh-0006vj-5s for submit@debbugs.gnu.org; Mon, 06 May 2024 12:52:25 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:56186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s41Zf-0006va-Lu for 69097@debbugs.gnu.org; Mon, 06 May 2024 12:52:24 -0400 DKIM-Signature: a=rsa-sha256; b=Gts0lDFYqUBuLO/rUwlcYyeFxXsvoQ9aJUMujyT7h1QuEZ7bMYLOLLeXgmqWRzclqJCvZZue8y2wAqStYD0Ouzz/If3Jpjy9f2fu8F6YjeQlOkJWyYm6sJoqS2v38xZ3pjUU1ENB66Qhf8Alw5WEUPCqXDiPE8G/YmhzL65brFzvR+RFbsOwARGVkABaFl7F34oEHr0wAQhGHQ//f8Oauxl2Syd8/6j35f7yD9K2IMoYfMMgE7m5zNKlrObO9y3ikCaIGkxWvfIxpeU5e8+Idu3/yxTmzV2eHrHPV8GPFbSDHF6sTI+vcb1+/lcsjVseG3PyBwBKdyWBadh1peejoQ==; s=purelymail2; d=spwhitton.name; v=1; bh=JPA+sIAI37mqWXrpK9hGpP/GmJ6g1GP8INLoyPXL3ro=; h=Received:Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=Xd3ysO/DUhuMoPl4kyTBpOKs+05So+eAi64Svhd24AIcwVEyit4BBWAuvNqqvKtRpEyNwQpQqfByZhJuNbqmYIPUaUHF4nBal6hXBcrdsxGMZyLm/HUWAfJhqAd4Dflk6TqXg+fonlCvpnwf7IkpRFlGTJKjp6uY/XH/1h06nchSkKoOwI7V4BIt9aay/T71a9LiJKMoRTANXjV01KQv/9qIDAPui+KE1cneZufZjn/vhSsL9PT+nbjlygwyO01RdPQX/HJHBST/wN7g5mF7R3zj+yt8Utxbt/jEFYeG8UpdEYofYn8epnSE0NwuuELhWY0KfjGEZwTnJ8g4CJz/4w==; s=purelymail2; d=purelymail.com; v=1; bh=JPA+sIAI37mqWXrpK9hGpP/GmJ6g1GP8INLoyPXL3ro=; h=Feedback-ID:Received:Received:From:To:Subject; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -2100807552; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 06 May 2024 16:51:49 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 25FC9947D9B; Mon, 6 May 2024 17:51:48 +0100 (BST) From: Sean Whitton To: Eli Zaretskii , Juri Linkov , philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87edaeevmr.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Mon, 06 May 2024 17:46:20 +0100") 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> <87edaeevmr.fsf@zephyr.silentflame.com> Date: Mon, 06 May 2024 17:51:48 +0100 Message-ID: <87a5l2evdn.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 06 May 2024 at 05:46pm +01, Sean Whitton wrote: > > In bash on Linux [...] I specifically called out Linux because while GNU readline has a unix-word-rubout command, C-w in the Linux tty is actually implemented in the Linux-specific tty layer, below readline. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 13:56:26 2024 Received: (at 69097) by debbugs.gnu.org; 6 May 2024 17:56:26 +0000 Received: from localhost ([127.0.0.1]:39357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s42Zd-00055p-T9 for submit@debbugs.gnu.org; Mon, 06 May 2024 13:56:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s42Zb-00055h-2U for 69097@debbugs.gnu.org; Mon, 06 May 2024 13:56:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s42Z6-0007SU-6K; Mon, 06 May 2024 13:55:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6QSXRI8ghim4Vto4vAn7aK72VBM2ugiH0/PsjIRyQfw=; b=GqdZVfECCrrZ 9KvlkjCnNZDfOxcjvZZ397rk9/hzk8t3sjOP/lpj4uZ0l6j5V+jBnDCSvgC+5lQDNSmXdMrWU5zZV vXAmtYN15hpvQUkQhPCCuFeTQSnVYcRZ08Y9o4WXiSduvOnCMa+bUcqQYcPo2g5RkqPnug9esDo0Z yKMpO+Bjmn1FCV7O0qUtHqVbzH1dJ+PaMBrORRCUOf1GfLtemCW2fOeIpvFP3bE04fraB+Fw9kurL 4wShNaZZPrOkLJ2JNvQUeDAqwP0a0Qkiq0uOf4ivnxYX5Rdk3ZM4YgMrZ22eUnojXcb65ghFiG8Wo T69gjL4qfYb1/7i/2Q4MMg==; Date: Mon, 06 May 2024 20:55:39 +0300 Message-Id: <86ikzqbzac.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87a5l2evdn.fsf@zephyr.silentflame.com> (message from Sean Whitton on Mon, 06 May 2024 17:51:48 +0100) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Date: Mon, 06 May 2024 17:51:48 +0100 > > On Mon 06 May 2024 at 05:46pm +01, Sean Whitton wrote: > > > > In bash on Linux [...] > > I specifically called out Linux because while GNU readline has a > unix-word-rubout command, C-w in the Linux tty is actually implemented > in the Linux-specific tty layer, below readline. Evidently, the above is inaccurate, because I see the same behavior in Bash on MS-Windows. From debbugs-submit-bounces@debbugs.gnu.org Tue May 07 04:48:06 2024 Received: (at 69097) by debbugs.gnu.org; 7 May 2024 08:48:06 +0000 Received: from localhost ([127.0.0.1]:42426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4GUX-0006jg-Tu for submit@debbugs.gnu.org; Tue, 07 May 2024 04:48:06 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:45298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4GUV-0006jJ-Fi for 69097@debbugs.gnu.org; Tue, 07 May 2024 04:48:05 -0400 DKIM-Signature: a=rsa-sha256; b=dcMop9u47XXiwxQppCalVpds8OEK+fsTSLf+o5QDRAFKYDAUPeQtIh6k1X8w9Eph1/tGN2zXaeqBMwN8+H0Y8C4THCxdTsrdlRA81Hb1G0j9lr73L85gR8yYtkbovP2yBrcSA3UziBR29FlMZ3BSsb2FGLSZX3VM3Fq+tC0vvwtztGmYQe9oTqbUoB+j2bpWim2Nk+S2AbirjegGhzhWsau8ubzLtTrDkSR1w7qPRc9cC0u0VE2/9FV0IODbnAA4By42pmmycuKoa+2UvK/hjXUGKls2LdMjl3m3wr4ft2cWagS5GxgJ30RMcK23MtgS8qqR/NuBKjwT57orhMxUug==; s=purelymail2; d=spwhitton.name; v=1; bh=MCcdJKu/nc1LFYRap2F9WrsLXLKo7Bhd/mq/5cpRQAQ=; h=Received:Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=RzZ0VzCP5kgtzBkChctAJgW6vN3zXm82iAfGMvqps7HFcr/OMJQbrtxeAPzX9cuh99yqZsBd4kxz/alZP99RyWp8MA+x4gnbSdrkYDz+ikPueJzLzmLdDunz+DVtmXqUiRUoX/8bmf9J9Ym8gysl/3LoN0c8PIpimkZPGOM39cdHdRNskro0bs2E13h1i6ax9IjKY2U6c17GzAhYF4gpL+MJEAVdIv+v3zOj7izXNPew85DDKpB567yaI8+zVrTSODHsh4DR0qtDe5CQk3fa4CLUiOHtj9MEHB4h1yhoqFHpgU7RjCANfAh+QuQA4MY7ZxSFHPJJLbZsjNdM02i+5A==; s=purelymail2; d=purelymail.com; v=1; bh=MCcdJKu/nc1LFYRap2F9WrsLXLKo7Bhd/mq/5cpRQAQ=; h=Feedback-ID:Received:Received:From:To:Subject; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1076252414; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 07 May 2024 08:47:32 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id B6A6A940403; Tue, 7 May 2024 09:47:30 +0100 (BST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86ikzqbzac.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 May 2024 20:55:39 +0300") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> Date: Tue, 07 May 2024 09:47:30 +0100 Message-ID: <875xvqc8kd.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 06 May 2024 at 08:55pm +03, Eli Zaretskii wrote: >> From: Sean Whitton >> Date: Mon, 06 May 2024 17:51:48 +0100 >> >> On Mon 06 May 2024 at 05:46pm +01, Sean Whitton wrote: >> > >> > In bash on Linux [...] >> >> I specifically called out Linux because while GNU readline has a >> unix-word-rubout command, C-w in the Linux tty is actually implemented >> in the Linux-specific tty layer, below readline. > > Evidently, the above is inaccurate, because I see the same behavior in > Bash on MS-Windows. I believe that this is why readline has the unix-word-rubout command, to ensure that terminal emulators work the same as the tty. Anyway, this is just implementation and not relevant to Jim's patch. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue May 07 04:48:26 2024 Received: (at 69097) by debbugs.gnu.org; 7 May 2024 08:48:26 +0000 Received: from localhost ([127.0.0.1]:42431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4GUs-0006k1-91 for submit@debbugs.gnu.org; Tue, 07 May 2024 04:48:26 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:42216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4GUr-0006jr-1j for 69097@debbugs.gnu.org; Tue, 07 May 2024 04:48:25 -0400 DKIM-Signature: a=rsa-sha256; b=ely2F0n50A3lOWlju+NCQngY5wuzM9d3ezW4PmbhTDRUJn6qD2I6Yp+va5VxgjVNKjNDuMh8QkOpx+rfiUtt98hg4W38aBsrVZnFKAfXosRG7jyWG8tN9L1djhrRAV4cou15y7u/QGpbUCTNWwCAzXMYGq/r2XLQWw1rTeIcEvh5kjS8jNONeUPxSUufFttle6mI3grq/QZib2rVyoy5BwuS+Jqi66Wrrw9S6IVIk8uTaFtfNalDXqofvZNAunyFqwi2pxwosR9SQZTp5S+gcRSm2v6DAPSkbj5CXltMP7YDqEqDxdTuQ8/IUZo5jltpOyri8x0kYYYJqSeDz+zg6g==; s=purelymail2; d=spwhitton.name; v=1; bh=m4vxjsf9fIXG8Z+kK+FMe3acbDiuDXn35lyACjrf4W4=; h=Received:Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=MbZIRIecgvndTBRTrdE4a6v/jhiWnS06zLpDHrwodzkXaa2L8nyfKvCY6KUtGCanmBlufrtx8Xq6oFjceKINZQSXKfI6dO/0O+GBYr57jjLqDQF5LoxmQh890rsyfuUpaHz8eceWI9w8MuhZHkq5AfuTJ5Dk1mYRKYcPx4XfqSerRMvyosddeK7rv4ugxTiCYAgKFj6et/NXg0C3Hc6F7X0YeQ378Bqvv8pFBvjALRStQBvb6+NQYTqOkW5K1T4xTz2CGKvbLBHoWyeabIxihRAYCjiZ0ObENnSWVUcvWzAXAdHJRRf+ohqnMyRSx74SPYMgaeN9tqV/S4Rr2DG7Ow==; s=purelymail2; d=purelymail.com; v=1; bh=m4vxjsf9fIXG8Z+kK+FMe3acbDiuDXn35lyACjrf4W4=; h=Feedback-ID:Received:Received:From:To:Subject; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 151782380; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 07 May 2024 08:47:51 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 2E905940403; Tue, 7 May 2024 09:47:50 +0100 (BST) From: Sean Whitton To: Eli Zaretskii , juri@linkov.net, philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <875xvqc8kd.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Tue, 07 May 2024 09:47:30 +0100") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <875xvqc8kd.fsf@zephyr.silentflame.com> Date: Tue, 07 May 2024 09:47:50 +0100 Message-ID: <87y18matzd.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue 07 May 2024 at 09:47am +01, Sean Whitton wrote: > > I believe that this is why readline has the unix-word-rubout command, to > ensure that terminal emulators work the same as the tty. Anyway, this > is just implementation and not relevant to Jim's patch. Phil's patch* -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 01 16:07:14 2024 Received: (at 69097) by debbugs.gnu.org; 1 Sep 2024 20:07:14 +0000 Received: from localhost ([127.0.0.1]:39451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skqqv-00040g-P2 for submit@debbugs.gnu.org; Sun, 01 Sep 2024 16:07:14 -0400 Received: from mout02.posteo.de ([185.67.36.66]:50697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skqqr-00040R-Sr for 69097@debbugs.gnu.org; Sun, 01 Sep 2024 16:07:10 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1B964240106 for <69097@debbugs.gnu.org>; Sun, 1 Sep 2024 22:06:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725221164; bh=+u9+UQ0banDvZKGRaN9SyR/IIq5wNMR7b2qUmCy4EIQ=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=g9fTjGa+gYO7X2NB37nz1HdI2A6OcGTgrSylkdXJWa4NPg87Ly67nNUcUrF2vIgpR MsrXDsATd4/ycK1JWX1i1ZM8kK9qAubIH2rVWFWwXOukypU0WakYscbmWGFyU+b5aF 5j42FHeuvQmx/xYbmOCbo0Jw/WM0AQGteXcOJSMIghCW8CBBgiTmYazSw5nhxHKUf8 sMIuiYsMmwj9Jw+Q/95lB47G9nfdalroz6NGmgtFgqQ5mZoEuNWFdzBtrOwGv9WQzz 8ocwH1tUPK5EXH3lxLGZfpvyKlg1CkbiWZLOlmUV2cFYF3BaIuZ3w/atakkH4ZZR7z 5iDGFZNC9846w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WxjZ06dp8z6twh; Sun, 1 Sep 2024 22:06:00 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86ikzqbzac.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 May 2024 20:55:39 +0300") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Sun, 01 Sep 2024 20:06:00 +0000 Message-ID: <87seujf8bb.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org, Sean Whitton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Sean Whitton >> Date: Mon, 06 May 2024 17:51:48 +0100 >> >> On Mon 06 May 2024 at 05:46pm +01, Sean Whitton wrote: >> > >> > In bash on Linux [...] >> >> I specifically called out Linux because while GNU readline has a >> unix-word-rubout command, C-w in the Linux tty is actually implemented >> in the Linux-specific tty layer, below readline. > > Evidently, the above is inaccurate, because I see the same behavior in > Bash on MS-Windows. Ping. I am not sure how to proceed on this patch. IIRC the issue was that the notion of a word differs in Emacs and in Bash. I am still in favour of utilising Emacs's definition, as it remains more useful for some given major mode and the fact that it is easier to implement. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 02:37:16 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 06:37:16 +0000 Received: from localhost ([127.0.0.1]:43309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sl0gd-0000y8-Oy for submit@debbugs.gnu.org; Mon, 02 Sep 2024 02:37:16 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:39998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sl0gb-0000xn-KJ for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 02:37:15 -0400 DKIM-Signature: a=rsa-sha256; b=FMV+AetECcoLapem6JD++sZ1L1ct7yPcdDpZwUftIbndZ8ey2oQEod1JJuvVh9cCr2RKw9iuEJxNwDc0uuLBm2SpR5eoJDvoU2Gbr8z5vJPaYjR47crP4vE30byBEa/jMSiHRY8BTrwyYkVrFG6YpyjCUZAak0zB++iO8IcRq9VuZNQ+MIZSTpuK19GcoPa8kxP5hXIw47a0xa7X6mlL7a6Bz+TY74EFGIV20srnXwdHoXK2t/YZfwYjMBkk4IXRCDhsiSnHrvgX0Gn+5Tya94u4LUZEXYhxLcsJbyw6Q/NT/7h2zeox6MKDEVQoUdEETnvt+/C/msJt2HSkCew9ug==; s=purelymail3; d=spwhitton.name; v=1; bh=f4l0LJcX9e/1mb619FQJhN5vtqdKrlGqfvCD87KTOZM=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=YezhFbfY0k9xNGgsSWz5GqWz6fibip27O39543WLPnVCwweQGoLh+x2MGi0szZlmP788UJEUweclfLoLNYbDjNIiOUbLKQMcM1UGHFEIHXR6/lBLDRDitdCehpwiWNjXDBdKN1NKlYCEaxHsYAvA+AgHIwbY3qjHJep0lPjOgMoAaHLj22cEB5+n8p8pjObPOOURrBNOoWaBRenlLsRVn7gij1vcStUYiuvq9LLfW2GjI6cLwr5bfJhLd/oO2sZgfYxbnFyp/1I74RVOHxY8c/wX1mNjErJmYiCGRhBren7863LzUE9u7d3LN/SSNwgHeukxt8qDByQhK57ytZUzOA==; s=purelymail3; d=purelymail.com; v=1; bh=f4l0LJcX9e/1mb619FQJhN5vtqdKrlGqfvCD87KTOZM=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -346858849; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 02 Sep 2024 06:36:06 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id AC2AA941E5F; Mon, 2 Sep 2024 07:36:05 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87seujf8bb.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 01 Sep 2024 20:06:00 +0000") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> Date: Mon, 02 Sep 2024 07:36:05 +0100 Message-ID: <87y14a8sve.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Sun 01 Sep 2024 at 08:06pm GMT, Philip Kaludercic wrote: > Ping. I am not sure how to proceed on this patch. IIRC the issue was > that the notion of a word differs in Emacs and in Bash. I am still in > favour of utilising Emacs's definition, as it remains more useful > for some given major mode and the fact that it is easier to implement. Please take a look at my longer message. I don't think it has been addressed. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 07:22:30 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 11:22:30 +0000 Received: from localhost ([127.0.0.1]:45546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sl58f-0006YT-QL for submit@debbugs.gnu.org; Mon, 02 Sep 2024 07:22:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sl58b-0006Xs-HI for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 07:22:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sl55O-0006FJ-HX; Mon, 02 Sep 2024 07:19:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CaYUcIpL0+EnDlp2rQmkGbYph8prVDuhaKSP37/blNU=; b=jnYSQIscnyn8 mU1q8tsdefx91oIlSkafvKweA1VHp9N9pq3KtU1wpWocrkDla39eK2VUbDDOdwXn/AWowX8+aO0by fgydl3RmNyH1W6pNPrdMCXEZMmF3drPh8jQ1D8tl3tPItxfNUssRTAxCe/lJDfJdT1hScSSxbEMZJ MQB3/ReFP2MBEO8IPnP3f4XWzHMf8CkH7BjpNi0zyibhmny0VhOABrUaMNUq60/V9k233Ej5qofVA NVt+N9yHPM0pO+BDpY5FcH8YOuijTQKwOVsSUkVU5ZD6xU9/Hbt1i7Q3iESXXk4PRvXC+8/S0p6f5 yxhfVcMIpDMVfw8dUVaApQ==; Date: Mon, 02 Sep 2024 14:18:57 +0300 Message-Id: <867cbu9uce.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic , Stefan Kangas , Andrea Corallo In-Reply-To: <87seujf8bb.fsf@posteo.net> (message from Philip Kaludercic on Sun, 01 Sep 2024 20:06:00 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: Sean Whitton , juri@linkov.net, rms@gnu.org, > 69097@debbugs.gnu.org > Date: Sun, 01 Sep 2024 20:06:00 +0000 > > Eli Zaretskii writes: > > >> From: Sean Whitton > >> Date: Mon, 06 May 2024 17:51:48 +0100 > >> > >> On Mon 06 May 2024 at 05:46pm +01, Sean Whitton wrote: > >> > > >> > In bash on Linux [...] > >> > >> I specifically called out Linux because while GNU readline has a > >> unix-word-rubout command, C-w in the Linux tty is actually implemented > >> in the Linux-specific tty layer, below readline. > > > > Evidently, the above is inaccurate, because I see the same behavior in > > Bash on MS-Windows. > > Ping. I am not sure how to proceed on this patch. IIRC the issue was > that the notion of a word differs in Emacs and in Bash. I am still in > favour of utilising Emacs's definition, as it remains more useful > for some given major mode and the fact that it is easier to implement. Or you could make the defcustom a tristate, and implement both behaviors... As for how to proceed: Stefan and Andrea, do you have an opinion on this? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 14:32:28 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 18:32:28 +0000 Received: from localhost ([127.0.0.1]:51129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slBql-0000WJ-JW for submit@debbugs.gnu.org; Mon, 02 Sep 2024 14:32:27 -0400 Received: from mail-lj1-f177.google.com ([209.85.208.177]:60482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slBqi-0000Vu-Fc for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 14:32:25 -0400 Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2f4f8742138so50596561fa.0 for <69097@debbugs.gnu.org>; Mon, 02 Sep 2024 11:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725301816; x=1725906616; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=W/WO1ZM57aDUJAmSRG0rVb+NQ70YT4ay5A/PBSlCyuM=; b=jo4FoppLH1qkV3ycJIms1CQcvHSRFSPPbiHOoAUvP2qU562CzXBVxbBY8fTreNcZqk e5cRAeyEv3fDP0fiYafJbl6Dc1BFs1SD/NAkksy1pQDGOmFB1VmUUCPMUJqL04IPeJEG uqWl/P1ZyEp5uYFfAPxhdrW7GSYWPpBKjjP7AAYGQFQMvZirrKxy0nZNqh8Hm5e+Dcbm C3P1T7ixWBgTmZekhqiGiE3vpmqxHtb4nNJBKrrEhksAwg1FL1Ik3ljqE7oDMmTyYS2U DbgexXS9AWN/4YkyatZQWLfrYR9gxcreCK/4HQ8nWiEjEMwB8VOTRe7BgPF+468uo3+H CJuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725301816; x=1725906616; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=W/WO1ZM57aDUJAmSRG0rVb+NQ70YT4ay5A/PBSlCyuM=; b=qcK3zxiP8V3NwJDp7G8wj0LhMsX0bLraa5tB1VHKqoY+saY4YKgpBgfh1/IMQu1P6M DIJkNev9wyux4hjAuGoBZ3nAQ4sg2r0xjoiXQh2V2JyUmSBpbqwtpZmdLyNonl9flUn4 dLd/NhMI5xNikjnYQm45WzlaY/07OZuaZeWma88sLyahWar1Xbg3kT6fq0bnUnoSJ3Kh oInGjRW/8Mc+Z7IDhPnXcK8zoQhOyDKfKsdzh09TzUhv2CZTaXGSUQjgEFQTo+uEKIVB So5b9lZ2inzPEVm3qHU01TxIbKJ0gWc6RLT8P0KrId+dlIboZfkHUVZSPp2XA+6oPIno +vDw== X-Forwarded-Encrypted: i=1; AJvYcCWtx29ZKfArBKwO3gnM+4RNOvf7lgYlDsa/zNa6pEw14XPm6Gf8lcrKWQUwr1AvtzgGcHoZWA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxzJiWd8YhInvyZHKiNATNb37JQyP053MMQUlzb6QxblXH9zsCo VWORMXOWi7IlcenPhdiaIgRZo3V12a78nGRj1chTZYtNJcGJbcBeZgRF3N7BRK+Vbz2ftOPpuZ6 aabgulncZYEWMVXeJkY2EMgDL1Pc= X-Google-Smtp-Source: AGHT+IEA65lhSy3z5cYkPMjCt+FeTO5Aj4NzHF/3YJz9lsSdXVYX7Ec0QvbC/bM4DEP0BzaZib9daSpEdNhzlZbfGH4= X-Received: by 2002:a05:651c:2207:b0:2f0:1f06:2b43 with SMTP id 38308e7fff4ca-2f6108a7771mr110686501fa.41.1725301815296; Mon, 02 Sep 2024 11:30:15 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 2 Sep 2024 11:30:14 -0700 From: Stefan Kangas In-Reply-To: <867cbu9uce.fsf@gnu.org> 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> MIME-Version: 1.0 Date: Mon, 2 Sep 2024 11:30:14 -0700 Message-ID: Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command To: Eli Zaretskii , Philip Kaludercic , Andrea Corallo Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Sean Whitton , juri@linkov.net, rms@gnu.org, >> 69097@debbugs.gnu.org >> Date: Sun, 01 Sep 2024 20:06:00 +0000 >> >> Ping. I am not sure how to proceed on this patch. IIRC the issue was >> that the notion of a word differs in Emacs and in Bash. I am still in >> favour of utilising Emacs's definition, as it remains more useful >> for some given major mode and the fact that it is easier to implement. > > Or you could make the defcustom a tristate, and implement both > behaviors... > > As for how to proceed: Stefan and Andrea, do you have an opinion on > this? Binding C-w to backward-kill-word, or some version thereof, is an old Emacs power user trick that has been recommended in many places over the years. See, for example: https://sites.google.com/site/steveyegge2/effective-emacs#h.p_ID_193 https://emacs-fu.blogspot.com/2009/11/copying-lines-without-selecting-them.html So I think this command would be a good addition. Making the word boundary behaviour into a tristate option sounds like a reasonable way forward, which should make everyone happy and let people experiment with what works best for them. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 14:46:38 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 18:46:39 +0000 Received: from localhost ([127.0.0.1]:52103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slC4U-0001DN-E5 for submit@debbugs.gnu.org; Mon, 02 Sep 2024 14:46:38 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:39954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slC4S-0001Cu-7w for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 14:46:37 -0400 DKIM-Signature: a=rsa-sha256; b=eadfuc01WiSXiLj3aUbrxzwZ6Bct+RHwQQQS8kWtOhO1sjwppHdZNyfXeuJ99aT/0AN17GY8Mp2RH6VrkfyJPi8aivsFxgIL/fN3TeCtmQtWAc0ZmPbGdVoRe/jD8mJP/Fj9tJ3bELiPIM3G3ft0J1Pg84TSFGDZyo2y4YUVF6WFty3Jx4PRgevzwGOnFAa+4io2jDFlNUQ/3m75dcRQb0OG0CjwfhKrLAgwkTItdLBD4yqDgNFlOlpmzscIBuLMvuNcJPSWviVPoqr50mvm8haIEcK17rPIwYDe5hnKAJYyVq5eRYnBiwN7XCtwa2TEjpGQxHUbOO748bDQRPt4Ww==; s=purelymail3; d=spwhitton.name; v=1; bh=W9/yQW+HqHCY324V99/ne1JhkwbVGcYGJ+YltrE/R7M=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=K2dVyjbHvQvexwbvlbvu4Ds6hCl6zQhVh1Sxd/CaueESMiI1Z2aqr7EHhwxx2Ds2gTRmrB6Lx+UoYLcJKRFZufZptlB2aPl9zIIUT4stbNbhaKm2Sn0dIIXXTuQDwVLIFMe1a3s6hU2Nm9c9yQAWwwoBQJWQNbft/HOqN/K4vzSpgvTz16AErefY23UZ+g7dzsxnH+jpRxQD+e8S7ZiGbLX+y9KaYF2qU7PmzYzhsKwwyuaO0kwEatOYOVkXfnF8HSmDm9JV1/pFU47g9LeywMhSlDMlcJQgfxLqppCgVxmamBccu7bj5cphiaR9oLSMl3y/Hctpd6UPRkj7SiFumA==; s=purelymail3; d=purelymail.com; v=1; bh=W9/yQW+HqHCY324V99/ne1JhkwbVGcYGJ+YltrE/R7M=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1480653900; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 02 Sep 2024 18:45:26 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 9CA3A9427D5; Mon, 2 Sep 2024 19:45:25 +0100 (BST) From: Sean Whitton To: Stefan Kangas , Eli Zaretskii , Philip Kaludercic , Andrea Corallo , juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: (Stefan Kangas's message of "Mon, 2 Sep 2024 11:30:14 -0700") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> Date: Mon, 02 Sep 2024 19:45:25 +0100 Message-ID: <87seuhki7u.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 02 Sep 2024 at 11:30am -07, Stefan Kangas wrote: > Binding C-w to backward-kill-word, or some version thereof, is an old > Emacs power user trick that has been recommended in many places over the > years. See, for example: > https://sites.google.com/site/steveyegge2/effective-emacs#h.p_ID_193 > https://emacs-fu.blogspot.com/2009/11/copying-lines-without-selecting-them.html > > So I think this command would be a good addition. Making the word > boundary behaviour into a tristate option sounds like a reasonable way > forward, which should make everyone happy and let people experiment with > what works best for them. For reference purposes while implementing the tristate, here is my implementation of the Unix behaviour from my init. Should be helpful, though there is lots of room for improvement :) (defun spw/unix-word-rubout (arg &optional pos neg) (interactive "p") ;; Do skip over \n because `backward-kill-word' does. (unless pos (setq pos "[:space:]\n")) (unless neg (setq neg "^[:space:]\n")) (undo-boundary) (let ((start (point))) ;; Go only backwards. (dotimes (_ (abs arg)) (skip-chars-backward pos) (skip-chars-backward neg)) ;; Skip forward over any read-only text (e.g. an Eshell or comint prompt). (when-let ((beg (and (get-char-property (point) 'read-only) (next-single-char-property-change (point) 'read-only nil start)))) (goto-char beg)) (kill-region start (point)))) -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 16:41:06 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 20:41:06 +0000 Received: from localhost ([127.0.0.1]:52722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDrF-0005Jy-Kx for submit@debbugs.gnu.org; Mon, 02 Sep 2024 16:41:06 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDrC-0005JF-Fy for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 16:41:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id EB367240029 for <69097@debbugs.gnu.org>; Mon, 2 Sep 2024 22:39:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725309595; bh=ebfm2m/Bq/DujcvKKvohYxhWHPqFzL9CBGi/VPSJXNU=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=asLY0QYsWskAjpZDtgXWQbIlLLibQNUkHftq4JHGB0EMH+Tqr1W9MGLYLNFpLRfpc r2FtCIYrGZYyViqrLHD+0nRUXxV99fJ/7e7+weu3y20gLq7CusyX8dw8n/p7Boo6KM u6oe+k902FlBAqxJc9Ej89NO5wZusu8syehhCnAV7QVArb3ciibNYdQTp6vItKmym7 rYq8XDIPM/kFAEIB1Nqrtk4AjF8dzi4X89CVZNMpszbQRq73QjWjJj7o5TjGHUCEjF HyaAQg620j5zMenviX4VqgBYt6CZR4Mb86NAOC80WaHjdTUg7E+KhgZPen6n0kY8hk J1SJZFZjZnUyg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WyLGd0w1Hz9rxF; Mon, 2 Sep 2024 22:39:53 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <867cbu9uce.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Sep 2024 14:18:57 +0300") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Mon, 02 Sep 2024 20:39:52 +0000 Message-ID: <87cyllg57r.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, Stefan Kangas , Andrea Corallo , spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Kangas writes: > Eli Zaretskii writes: > >>> From: Philip Kaludercic >>> Cc: Sean Whitton , juri@linkov.net, rms@gnu.org, >>> 69097@debbugs.gnu.org >>> Date: Sun, 01 Sep 2024 20:06:00 +0000 >>> >>> Ping. I am not sure how to proceed on this patch. IIRC the issue was >>> that the notion of a word differs in Emacs and in Bash. I am still in >>> favour of utilising Emacs's definition, as it remains more useful >>> for some given major mode and the fact that it is easier to implement. >> >> Or you could make the defcustom a tristate, and implement both >> behaviors... >> >> As for how to proceed: Stefan and Andrea, do you have an opinion on >> this? > > Binding C-w to backward-kill-word, or some version thereof, is an old > Emacs power user trick that has been recommended in many places over the > years. See, for example: > https://sites.google.com/site/steveyegge2/effective-emacs#h.p_ID_193 > https://emacs-fu.blogspot.com/2009/11/copying-lines-without-selecting-them.html > > So I think this command would be a good addition. Making the word > boundary behaviour into a tristate option sounds like a reasonable way > forward, which should make everyone happy and let people experiment with > what works best for them. How about this suggestion: We add a generic kill-region-or-word command, and a user option for a function (set to either `backward-kill-word' or Sean's `unix-word-rubout'). I can prepare a patch with the simpler version, and then Sean can add his behaviour in a second patch so that the attribution remains correct. Sean Whitton writes: > Hello, > > On Mon 02 Sep 2024 at 11:30am -07, Stefan Kangas wrote: > >> Binding C-w to backward-kill-word, or some version thereof, is an old >> Emacs power user trick that has been recommended in many places over the >> years. See, for example: >> https://sites.google.com/site/steveyegge2/effective-emacs#h.p_ID_193 >> https://emacs-fu.blogspot.com/2009/11/copying-lines-without-selecting-them.html >> >> So I think this command would be a good addition. Making the word >> boundary behaviour into a tristate option sounds like a reasonable way >> forward, which should make everyone happy and let people experiment with >> what works best for them. > > For reference purposes while implementing the tristate, here is my > implementation of the Unix behaviour from my init. > Should be helpful, though there is lots of room for improvement :) > > (defun spw/unix-word-rubout (arg &optional pos neg) > (interactive "p") > ;; Do skip over \n because `backward-kill-word' does. > (unless pos (setq pos "[:space:]\n")) > (unless neg (setq neg "^[:space:]\n")) > (undo-boundary) > (let ((start (point))) > ;; Go only backwards. > (dotimes (_ (abs arg)) > (skip-chars-backward pos) > (skip-chars-backward neg)) > ;; Skip forward over any read-only text (e.g. an Eshell or comint prompt). > (when-let ((beg (and (get-char-property (point) 'read-only) > (next-single-char-property-change > (point) 'read-only nil start)))) > (goto-char beg)) > (kill-region start (point)))) FWIW I don't have any suggestions on how to improve the function either. I wonder if it would make sense to have a minor mode like subword-mode that would enforce a understanding of words like implemented here. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 16:44:01 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 20:44:01 +0000 Received: from localhost ([127.0.0.1]:52740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDu5-0005Ps-Fq for submit@debbugs.gnu.org; Mon, 02 Sep 2024 16:44:01 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:34636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDu2-0005PX-Dd for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 16:43:59 -0400 DKIM-Signature: a=rsa-sha256; b=XUZOEnD4BnBWem/2Dmm7+Pi/LcN0Nwxf7bBwSnfMnKFfuQqgcaQJAFBC14Q/yT8nM12TjuQLioUh0Msw9JWXLuD3obLhA2hq0xdSj2yzZxa4XVSo/ga+q4VnY/6ZsY5W0OE+0liBzeqEiBVSnjmWyv19qIA+WaRY3adLzx0qCKZT1B5azBWa46sqcsXSt/CGfrzU8+7q2jTq5uZ8fq0qlLgHNuYEyRHorRb72xm4BUtbwAotaWGTJutimnvQzW/PIhQ9OMvVWMHP65O7d/fjc19KviZ4qvqglGnL/Fnof3MsIkbN7dekWQTtSEg33EUfAOcJQ5p6+sCPfaixMf75vQ==; s=purelymail1; d=spwhitton.name; v=1; bh=PhOB4uQ9uMnjS/MytYVu2z0U4hiyhcjE9tWUJtSpKIs=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=t22hxEfEKTPL2NDpEJ5T7rqlrSHhACefC8aTLm9fOSd3/felyOxO3R7D5Nm64TY6JKeNmnIeFu6PfxGpTE+ipBcKfdw+DkHTH73nwpHveFctkFzpjFT1UczbWNjGm2q1errN4w6f/q8VEc81LjBBOp2ZBWhUNoMz12lPwhBHDUPAQ00qNNJE8xVJgAsY5aRjh37m7KtD3Q3cEe6Uxm0kh60A5BcY7Q3v9P1TLI+ZgCgCyJBDHckNd2iipc5YlDxJbLQa6DyQUW5hRhvTpfIRSJmnwzs2FR7blIS2Ith17XZo695163CbyFWHT2DhD1oLMrnpbTx7PWueKs+CHybskA==; s=purelymail1; d=purelymail.com; v=1; bh=PhOB4uQ9uMnjS/MytYVu2z0U4hiyhcjE9tWUJtSpKIs=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -2084791584; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 02 Sep 2024 20:42:48 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id B6E4D9427D5; Mon, 2 Sep 2024 21:42:47 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87cyllg57r.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 02 Sep 2024 20:39:52 +0000") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> Date: Mon, 02 Sep 2024 21:42:47 +0100 Message-ID: <87zfopbxdk.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, Stefan Kangas , Eli Zaretskii , Andrea Corallo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 02 Sep 2024 at 08:39pm GMT, Philip Kaludercic wrote: > How about this suggestion: We add a generic kill-region-or-word > command, and a user option for a function (set to either > `backward-kill-word' or Sean's `unix-word-rubout'). I can prepare a > patch with the simpler version, and then Sean can add his behaviour in a > second patch so that the attribution remains correct. I think a tristate option is preferable to this. If the user wants something of their own they can just write their own command. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 16:46:27 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 20:46:27 +0000 Received: from localhost ([127.0.0.1]:52749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDwR-0005VD-0S for submit@debbugs.gnu.org; Mon, 02 Sep 2024 16:46:27 -0400 Received: from mout02.posteo.de ([185.67.36.66]:39901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDwP-0005Ut-N4 for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 16:46:26 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 377BA240101 for <69097@debbugs.gnu.org>; Mon, 2 Sep 2024 22:45:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725309918; bh=6tTvNzXryOcc9o9LMXsxzeBPqZtokTHdrKjm5qVK7os=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=jnY+FvIUzDpKdW87aMd+MymvcbUrd8WZ0l6bN4tzY7UPSYzCCybnrb1jLH+I8e0tC e7Uyav0XqoAQVs65c1uIVd5FmctpI+sI722odWOlvfWemOcwPoO+MCj+OqoE8ZzA51 1xw9yH/nxxxR8JOKg5q+A9Qb+r+vqxcDCUKNjMU4HuLkQjB1V4ecoZoQ7obQtvRox/ aOjQ+hsdPbG2NQtD0DXInQMhS/S567q/0UvFKjZ+lTFfnkB2q+oTtrl3saIogBAsr8 6bSz9A/XmKE21IfUWnTnWuNveyXtIzSiz4Nchvy2Cpi8A60XBC1RXrX/zfo/0+SQ+p JFfMLCNR0ZOBA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WyLNr35mvz6twX; Mon, 2 Sep 2024 22:45:15 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87zfopbxdk.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Mon, 02 Sep 2024 21:42:47 +0100") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Mon, 02 Sep 2024 20:45:14 +0000 Message-ID: <878qw9g4yt.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, Stefan Kangas , Eli Zaretskii , Andrea Corallo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > Hello, > > On Mon 02 Sep 2024 at 08:39pm GMT, Philip Kaludercic wrote: > >> How about this suggestion: We add a generic kill-region-or-word >> command, and a user option for a function (set to either >> `backward-kill-word' or Sean's `unix-word-rubout'). I can prepare a >> patch with the simpler version, and then Sean can add his behaviour in a >> second patch so that the attribution remains correct. > > I think a tristate option is preferable to this. It would still be a user options with three states: - nil (default, don't delete a word) - #'backward-kill-word - #'unix-word-rubout > If the user wants something of their own they can just write their own > command. Sure, but going by that logic we don't need this change at all. -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 16:47:17 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 20:47:17 +0000 Received: from localhost ([127.0.0.1]:52755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDxF-0005X4-Ey for submit@debbugs.gnu.org; Mon, 02 Sep 2024 16:47:17 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:35152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slDxE-0005Wl-3O for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 16:47:16 -0400 DKIM-Signature: a=rsa-sha256; b=aXIfKdtq0pKNv03zeGM8CZsCn/f9uvSB/3q7vkur73/ExKd4yXi33v76Z0Ux3g73MYiEKfGvsk/u+V1v1SLhT3FrALpDVeR4CiHJN7A3b6OCFUHShwSu4S4z5nQUDOkbI9pseH4Y8Ub5UQtoXUPvHWW+h+IlbGUwyb223T1XN0I9I1yjSLGB0z9rHIF1Dw8YkccRDou1a+Ao5L6oADxERfl8cJI8A40Tej7yPYhxUgzNgFaGSXTn2OncrwddDZXVAYONSjvyfpXaOvHYyRkKz9/jMnqeirwo/S1INeIYCcPov7e9E3C3D9IS6sW/4ENh2ZtjWAxw5OJBJJfwjqu+qw==; s=purelymail1; d=spwhitton.name; v=1; bh=Mixg2a8cnAzh/EfSEuAQ7x0sLXpQEiZXnURo2Y4mOk0=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Kqw1/z5NSoWOJnE8UOXcT1gTtD5hhCpA1dXZ0eiyoEkyoMhz2rS3LA/pFV/hgKRQYiXAvGrYR079bezm/YI9zEjfaGzgWzsSNYppieZ0++/76dLXMIongulzYBXCDd9pBkM1dP2vvLaXASDsIqUaS8cOoT6bWlcU/e3L2UlWUf5Yd4iertJykRJ6UN7QsVRlOmT3Vpg/8fY/K3rzmeFIvCEmO/vvCgnIY+kWmbFud5nDFM6qh3g2yUQFhWPU3Ex64A1nGAUFnMKc9b30DtESLgnwX3I2acWfxmlgdecwrEzekkDklD2p0waPuJ2RxrSupAVffbt7n8cTETTaXEFVzA==; s=purelymail1; d=purelymail.com; v=1; bh=Mixg2a8cnAzh/EfSEuAQ7x0sLXpQEiZXnURo2Y4mOk0=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -371510480; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 02 Sep 2024 20:46:01 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id C39609427D5; Mon, 2 Sep 2024 21:46:00 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87zfopbxdk.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Mon, 02 Sep 2024 21:42:47 +0100") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> Date: Mon, 02 Sep 2024 21:46:00 +0100 Message-ID: <87seuhbx87.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, Stefan Kangas , Eli Zaretskii , Andrea Corallo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 02 Sep 2024 at 09:42pm +01, Sean Whitton wrote: > Hello, > > On Mon 02 Sep 2024 at 08:39pm GMT, Philip Kaludercic wrote: > >> How about this suggestion: We add a generic kill-region-or-word >> command, and a user option for a function (set to either >> `backward-kill-word' or Sean's `unix-word-rubout'). I can prepare a >> patch with the simpler version, and then Sean can add his behaviour in a >> second patch so that the attribution remains correct. > > I think a tristate option is preferable to this. > > If the user wants something of their own they can just write their own > command. Sorry, I wrote this too quickly, I don't think I actually understand your new proposal. Could you sketch it out? Thank you for your patience on this one. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 02 17:13:12 2024 Received: (at 69097) by debbugs.gnu.org; 2 Sep 2024 21:13:12 +0000 Received: from localhost ([127.0.0.1]:52777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slEMK-0006QC-5G for submit@debbugs.gnu.org; Mon, 02 Sep 2024 17:13:12 -0400 Received: from mout01.posteo.de ([185.67.36.65]:33057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slEMI-0006Pz-9A for 69097@debbugs.gnu.org; Mon, 02 Sep 2024 17:13:11 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3F91624002A for <69097@debbugs.gnu.org>; Mon, 2 Sep 2024 23:12:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725311523; bh=mGhptGdpERKZUFrTZHfBrZ4fhcfZR/kPyuUA3CeNxCI=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=NdhSUmZkQ+SuWhjpK5A9y0U2oqUM1pILi+RVqfRereJRj0AIlV9lPEQAsRmdehxVG vBNWGM6v8qayDqCMP/5xXC2ECXLcTfpbGRRL5Fcwt8hf1vyM5bknuxJyFllzMvSx1l FU0ZpiWPfDy5QM4jLNK7VQpKoMMj9tgRrCIDnT5DpB5DBcbljZ3zbGf3SKgaIbztVm VY3juwr069oZdJnOXwD1qW7c5BM5uHSjrGWz7pBlIVxDelb8XSpNiwrRrLJVbwdAGy cFpipjt1SGlKeuJCJHG0LrXe7DgUDTCBG4fxwPKDbv/WpdsTgyJ9iuOQWXl9XTaBpi TFjaw5juxEFiQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WyLzk2D7Rz9rxF; Mon, 2 Sep 2024 23:12:02 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87seuhbx87.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Mon, 02 Sep 2024 21:46:00 +0100") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Mon, 02 Sep 2024 21:12:01 +0000 Message-ID: <87zfopep5q.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, Stefan Kangas , Eli Zaretskii , Andrea Corallo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Sean Whitton writes: > Hello, > > On Mon 02 Sep 2024 at 09:42pm +01, Sean Whitton wrote: > >> Hello, >> >> On Mon 02 Sep 2024 at 08:39pm GMT, Philip Kaludercic wrote: >> >>> How about this suggestion: We add a generic kill-region-or-word >>> command, and a user option for a function (set to either >>> `backward-kill-word' or Sean's `unix-word-rubout'). I can prepare a >>> patch with the simpler version, and then Sean can add his behaviour in a >>> second patch so that the attribution remains correct. >> >> I think a tristate option is preferable to this. >> >> If the user wants something of their own they can just write their own >> command. > > Sorry, I wrote this too quickly, I don't think I actually understand > your new proposal. > > Could you sketch it out? > > Thank you for your patience on this one. I had misremembered the last state of this patch. It is easier to just have a tristate option. Here is the updated proposal: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/simple.el b/lisp/simple.el index eedc5768fe2..9ce108089e7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5817,6 +5817,17 @@ kill-read-only-ok :type 'boolean :group 'killing) +(defcustom kill-word-if-no-region nil + "Behaviour when `kill-region' is invoked without an active region. +If set to nil (default), then an error occurs and nothing is killed. If +set to `emacs-word', then kill a the last word as defined by the current +major mode. If set to `unix-word', then kill the last word in the style +of a shell like Bash, disregarding the major mode." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil)) + :group 'killing) + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5839,25 +5850,47 @@ kill-region the text, but put the text in the kill ring anyway. This means that you can use the killing commands to copy text from a read-only buffer. -Lisp programs should use this function for killing text. - (To delete text, use `delete-region'.) -Supply two arguments, character positions BEG and END indicating the - stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current - region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." +Lisp programs should use this function for killing text. (To delete +text, use `delete-region'.) Supply two arguments, character positions +BEG and END indicating the stretch of text to be killed. If the +optional argument REGION is non-nil, the function ignores BEG and END, +and kills the current region instead. If REGION has the special value +`kill-word', then it will kill the previous word, as with +`backward-kill-word'. Interactively, REGION is always non-nil, and so +this command always kills the current region." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) - (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + (cond + ((and beg end (use-region-p)) + (list beg end 'region)) + (kill-word-if-no-region + (list beg end kill-word-if-no-region)) + ((user-error "The mark is not set now, so there is no region")))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((eq region 'emacs-word) + (let ((end (point))) + (save-excursion + (forward-word -1) + (filter-buffer-substring (point) end 'delete)))) + ((eq region 'unix-word) + (let ((end (point))) + (save-excursion + (skip-chars-backward "[:space:]") + (skip-chars-backward "^[:space:]") + (filter-buffer-substring + (if (get-char-property (point) 'read-only) + (next-single-char-property-change + (point) 'read-only nil end) + (point)) + end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) --=-=-= Content-Type: text/plain -- Philip Kaludercic on peregrine --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 08:23:18 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 12:23:18 +0000 Received: from localhost ([127.0.0.1]:59323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slSZ4-0001zC-4t for submit@debbugs.gnu.org; Tue, 03 Sep 2024 08:23:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slSZ2-0001yt-4s for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 08:23:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slSXu-0004yV-El; Tue, 03 Sep 2024 08:22:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wiPEP5tQYdH7RRHLjB0s4g7l/rnXtCWMuZRC4ATUXxc=; b=SjkGFyDHkjMl bTcFMsg+z3oRVfwyTKMLDqvrZMAOuvUEOEuzcJKO0Lp3EIo/GIzcyY43pmu9LiJIQcylzNsUR9W2V LNYY0hc8LXxMYHdf7FWeODhkDV+b47v/o01HZnD4rcyz3IS0AFALvDr4sJkVqwqeKk0OL+MkhlIkA DouytEph7lAzaa8DajtY+r/dEsolJ0IVKw74KMWuGHLfXJsqzCOgmYlIEXH2YjyxOjtmKwRT7GQDH HiAbCEQ+WkY2bZmgm1qHxb9mFkRdtF7J2HEbXLS59+Omeg/p4WQNtb4wOifrfFEsSIaRVsOeWqla7 5Wx2Ofs2T91R26Ar29ar6A==; Date: Tue, 03 Sep 2024 15:21:54 +0300 Message-Id: <86r0a16i71.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87zfopep5q.fsf@posteo.net> (message from Philip Kaludercic on Mon, 02 Sep 2024 21:12:01 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: Eli Zaretskii , Stefan Kangas , > Andrea Corallo , juri@linkov.net, rms@gnu.org, > 69097@debbugs.gnu.org > Date: Mon, 02 Sep 2024 21:12:01 +0000 > > I had misremembered the last state of this patch. It is easier to just > have a tristate option. Here is the updated proposal: Thanks. > +(defcustom kill-word-if-no-region nil I would call this 'kill-region-dwim' instead. > + "Behaviour when `kill-region' is invoked without an active region. > +If set to nil (default), then an error occurs and nothing is killed. If > +set to `emacs-word', then kill a the last word as defined by the current > +major mode. If set to `unix-word', then kill the last word in the style > +of a shell like Bash, disregarding the major mode." > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > + (const :tag "Kill a word like Bash would" unix-word) > + (const :tag "Do not kill anything" nil)) > + :group 'killing) :version tag is missing. > -Lisp programs should use this function for killing text. > - (To delete text, use `delete-region'.) > -Supply two arguments, character positions BEG and END indicating the > - stretch of text to be killed. If the optional argument REGION is > - non-nil, the function ignores BEG and END, and kills the current > - region instead. Interactively, REGION is always non-nil, and so > - this command always kills the current region." > +Lisp programs should use this function for killing text. (To delete > +text, use `delete-region'.) Supply two arguments, character positions > +BEG and END indicating the stretch of text to be killed. If the > +optional argument REGION is non-nil, the function ignores BEG and END, > +and kills the current region instead. If REGION has the special value Not sure why you decided to reformat this part. Its formatting was not random. This also needs a NEWS entry. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 10:07:52 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 14:07:52 +0000 Received: from localhost ([127.0.0.1]:60360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUCF-0005LR-DU for submit@debbugs.gnu.org; Tue, 03 Sep 2024 10:07:51 -0400 Received: from [209.85.208.173] (port=51391 helo=mail-lj1-f173.google.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUAw-0005JF-RQ for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 10:07:50 -0400 Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2f3eabcd293so61930131fa.2 for <69097@debbugs.gnu.org>; Tue, 03 Sep 2024 07:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725372255; x=1725977055; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=QK4Pg3twYzsvG7wEX0thhXygMDeXC0Xv4euB/WLYSkE=; b=TJTfCYfvNZWEpWENOYqaBJRlTdA+T+UHjyBEroaA0z/uQFlHNk6a70hpm9B2989Qdn UCBYSdgT++6C6ESU7ErIf550FMNf3EbnqkzGZ3/52mJOmXrEHL1Pt1bWpYHWCpRUlPgs WhFg03+LGe62EYVSMJtso3Jogz2QworAYQVWGMttEHTIW/eyfvoI14kt0RH8D5FQgvHN E4ODBJdBpxY9kEWpAdgQaJ/r9aO4pHJFWcfBDdLTTVoHrmKOK2SjbbiWAwPnV4Hn0bmV 26nct85EkMoYuopVSnTBVwj6gBOL+uZCbYVX1kndAR7JbiFyHiOyQHi5ijG2MN74EFgI 5ptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725372256; x=1725977056; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QK4Pg3twYzsvG7wEX0thhXygMDeXC0Xv4euB/WLYSkE=; b=XNEQDPEUeMDFnFA/CyFM9nUABev1K91B4j1Pm0kb/aW/J0pMNSNYqmBpNIIjrr+tQQ jBYGtWovMVXL97r/AuVfQeVWWcUO+LMXL6VGR5aw4dPcPyP7JN7On5YPVVQJl/R0eNF1 8G420+VvHHYtD+25nZXrUKN2oh94vq2ifHPuB3qc/SEFZvNL3/nID7jc1jKh+1kR0e9E LyW+n7Z5aM3znLDji93TOumbo6LX+n0UlbCnhjg8fvOkrkIxf8mJp/Yg9dVVwoY26Sdl o2yXKDDUuS62vhUFHt3Psgl7HBa7ss9sn9Y8T+TFiQh0lUCDv3B6VbAOogsijF1XQfN7 RfiA== X-Forwarded-Encrypted: i=1; AJvYcCWS8PnZZnXvFI6sCNZRloCMfEeK3ohZfDh3pW944G5K3kLNWORVWsXtYYzo3FFSUirRmgswAA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzj2PxjGbnXvuaQOgwDkxd+2eIl8KHzhFX06+azI+E0u/BHsdDR oj6pH/hHBhtBW1oTB9Cio7gHrcx3KhAlTUxEU7ngxTox2xg1+MYRGkyuYw== X-Google-Smtp-Source: AGHT+IHGcVG7KI+9Otx1hMbXpg+ICbO2WwpQk2OM2I2nXQGV/QCPsCULBrrohTz5RfI7UWb3fOjO9Q== X-Received: by 2002:a05:600c:3582:b0:42b:9260:235f with SMTP id 5b1f17b1804b1-42c7b5b4b72mr62374495e9.19.1725371621236; Tue, 03 Sep 2024 06:53:41 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:c8aa:69e8:c66e:716f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bacaac810sm192148425e9.33.2024.09.03.06.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 06:53:40 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86r0a16i71.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 03 Sep 2024 15:21:54 +0300") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> Date: Tue, 03 Sep 2024 15:53:39 +0200 Message-ID: <87ttewu9lo.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >>>>> On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , Stefan Kangas , >> Andrea Corallo , juri@linkov.net, rms@gnu.org, >> 69097@debbugs.gnu.org >> Date: Mon, 02 Sep 2024 21:12:01 +0000 >> >> I had [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rpluim[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.173 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 69097 Cc: Philip Kaludercic , rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >>>>> On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , Stefan Kangas , >> Andrea Corallo , juri@linkov.net, rms@gnu.org, >> 69097@debbugs.gnu.org >> Date: Mon, 02 Sep 2024 21:12:01 +0000 >> >> I had misremembered the last state of this patch. It is easier to just >> have a tristate option. Here is the updated proposal: Eli> Thanks. >> +(defcustom kill-word-if-no-region nil Eli> I would call this 'kill-region-dwim' instead. >> + "Behaviour when `kill-region' is invoked without an active region. >> +If set to nil (default), then an error occurs and nothing is killed. If >> +set to `emacs-word', then kill a the last word as defined by the current >> +major mode. If set to `unix-word', then kill the last word in the style >> +of a shell like Bash, disregarding the major mode." >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) >> + (const :tag "Kill a word like Bash would" unix-word) >> + (const :tag "Do not kill anything" nil)) >> + :group 'killing) Eli> :version tag is missing. Is it worth allowing a user-specified function? Robert -- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 10:29:22 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 14:29:22 +0000 Received: from localhost ([127.0.0.1]:60457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUX4-0005zp-Cm for submit@debbugs.gnu.org; Tue, 03 Sep 2024 10:29:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUX1-0005zS-1Q for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 10:29:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slUVu-0002xm-5p; Tue, 03 Sep 2024 10:28:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ufy4PWL4L6ZfJhGFzbwnDm7IBqH+DUBT85apJ/aidRk=; b=MEwFrfp8M7kL bEadIx3FD5gWas+iG3DWGJ6oXIhdF9HUqLQFIQroKiT8sd0ISTk5BoYlZfFEobYIW6wFebfSpuMAL Ea5e1YuceY+rGQttkAomxnaB8ozqEfrMxq+tUDHZpC7FbDaXxrQm83SVDaaUTf5qxqY9aTP9lfOkD oQ11iGEvx3jD9ilpnSF7xngtyaqffzoebXtZlgex13gKd9rHe1Jlifccgm8H3J28JcvaxlSG0uRyq 42NJ+fRjui4Zsi4NRjkLqHyjW0KMhSH3yE8xyUrp5MLJyHXaserscI6ggA9D3F1GpVZsFmGrSzxg3 jDqm1MoH+LyPo+KfaCEO7A==; Date: Tue, 03 Sep 2024 17:27:59 +0300 Message-Id: <86bk147qxc.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87ttewu9lo.fsf@gmail.com> (message from Robert Pluim on Tue, 03 Sep 2024 15:53:39 +0200) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <87ttewu9lo.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: Philip Kaludercic , rms@gnu.org, > 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, > acorallo@gnu.org, spwhitton@spwhitton.name > Date: Tue, 03 Sep 2024 15:53:39 +0200 > > >>>>> On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: > > >> From: Philip Kaludercic > >> Cc: Eli Zaretskii , Stefan Kangas , > >> Andrea Corallo , juri@linkov.net, rms@gnu.org, > >> 69097@debbugs.gnu.org > >> Date: Mon, 02 Sep 2024 21:12:01 +0000 > >> > >> I had misremembered the last state of this patch. It is easier to just > >> have a tristate option. Here is the updated proposal: > > Eli> Thanks. > > >> +(defcustom kill-word-if-no-region nil > > Eli> I would call this 'kill-region-dwim' instead. > > >> + "Behaviour when `kill-region' is invoked without an active region. > >> +If set to nil (default), then an error occurs and nothing is killed. If > >> +set to `emacs-word', then kill a the last word as defined by the current > >> +major mode. If set to `unix-word', then kill the last word in the style > >> +of a shell like Bash, disregarding the major mode." > >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > >> + (const :tag "Kill a word like Bash would" unix-word) > >> + (const :tag "Do not kill anything" nil)) > >> + :group 'killing) > > Eli> :version tag is missing. > > Is it worth allowing a user-specified function? I don't understand what you are asking, sorry. Allow a function where and to do what? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 10:57:43 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 14:57:43 +0000 Received: from localhost ([127.0.0.1]:60518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUyU-0006py-WB for submit@debbugs.gnu.org; Tue, 03 Sep 2024 10:57:43 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:46465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slUyS-0006pj-Id for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 10:57:41 -0400 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42bb6d3e260so46111325e9.1 for <69097@debbugs.gnu.org>; Tue, 03 Sep 2024 07:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725375332; x=1725980132; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fzy4pwG2c/ej7uhM77aNTGlzBWy5ldl/kQ9Iaxt/mxE=; b=VsjKhtFV1u8a4GrEnvB9+xlAjL6/OmxmmTWwrwdEP8NZBxwgg3N/KGttpW7MamDA3O RhHN4uO/m9/4gXeeOnarLZicETluyaJJT8aL/dLBFHbWzOUlYwXXBpSE85EFLBOz1WN0 bpVnb+D1rd/Q2MyUBmExi2NXeYQO1YOgq8YZxtZp074Tw32aqwelS/+rPe58E65fDcGj GbX21iV+0GwueHx8ThGdEEg5vi8jcy2ZU9tijlOUvnIk7qHBpKVZjizd2HiRfD/1j1/4 qVdl0WXDtyMTDcMq3wMJ3ojKgr6cKgoXf/n3wSZKUnWVLfaec5Samqe8c2ktW6RXv5K4 7+MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725375332; x=1725980132; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fzy4pwG2c/ej7uhM77aNTGlzBWy5ldl/kQ9Iaxt/mxE=; b=n5kbyhtyQKCj1uLo+ol+nF6GR3OpM24JlELmx3F3o1jZlg7YpmHw22+yT7F8p3j1nk sZIfEmBZqNfMTy8NmtFbaONT+flAbwrXuvl2Ch8qXuBT44kDaoZDIXni8HYlUAFozPbM 88noyVjRpuioFvJxV/bwc2xW4S3nXJRWFyMW63zy6dCFmcUQnIamGSX32gzb+X22Qd2/ +hrBN4i11K5keqHd3vet9Mzh4iob/xoRrGxAJzQ04XYfJ+RqN80+jczUO8waR2cZPUxm BDKLg3oguY06pVJm+6oPnu9KDXlIwve5QVWRS55kMfjmwUThQTN9M3eyktTGpRakN6x7 Iyrw== X-Forwarded-Encrypted: i=1; AJvYcCUVn1xDkCqR/WiY2DVM5cqN/eLXHNUq5MNYlFP/1gJDvU1Zqc7RfGpG2fW1LMOIcv5e5KPZXQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yyo8P2x+03aM86La97RdyccrXpGW1jOUQIM6CbQbmEHQ8d4770J wpnTmh4hFNs1LhiuEcTukeWnx2PALH6Ehm6H/EHlHrvTBKAoXSmG X-Google-Smtp-Source: AGHT+IFEWPSwUnFaCNRnG0XbUp174ypYw6+4YBR4tFf96qKf65wFYgCtyt504tFVEk8j6Z26dmO2YQ== X-Received: by 2002:a05:600c:3503:b0:428:2e9:6573 with SMTP id 5b1f17b1804b1-42bdc6370a2mr76978015e9.17.1725375332042; Tue, 03 Sep 2024 07:55:32 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:c8aa:69e8:c66e:716f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42c846d2fdesm62866205e9.22.2024.09.03.07.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 07:55:30 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86bk147qxc.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 03 Sep 2024 17:27:59 +0300") References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <87ttewu9lo.fsf@gmail.com> <86bk147qxc.fsf@gnu.org> Date: Tue, 03 Sep 2024 16:55:29 +0200 Message-ID: <87plpku6qm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 03 Sep 2024 17:27:59 +0300, Eli Zaretskii said: >> >> + "Behaviour when `kill-region' is invoked without an active reg= ion. >> >> +If set to nil (default), then an error occurs and nothing is kil= led. If >> >> +set to `emacs-word', then kill a the last word as defined by the= current >> >> +major mode. If set to `unix-word', then kill the last word in t= he style >> >> +of a shell like Bash, disregarding the major mode." >> >> + :type '(choice (const :tag "Kill a word like `backward-kill-wo= rd'" emacs-word) >> >> + (const :tag "Kill a word like Bash would" unix-= word) >> >> + (const :tag "Do not kill anything" nil)) >> >> + :group 'killing) >>=20 Eli> :version tag is missing. >>=20 >> Is it worth allowing a user-specified function? Eli> I don't understand what you are asking, sorry. Allow a function w= here Eli> and to do what? The current proposal offers three fixed behaviours. I=CA=BCm wondering if it makes sense for the user option to be allowed to be a user-defined function, in case someone wants a different behaviour, ie +(defcustom kill-word-if-no-region nil + "Behaviour when `kill-region' is invoked without an active region. +If set to nil (default), then an error occurs and nothing is killed. If +set to `emacs-word', then kill a the last word as defined by the current +major mode. If set to `unix-word', then kill the last word in the style +of a shell like Bash, disregarding the major mode. If set to a +function, call that function." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs= -word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil) + (symbol :tag "User function") + :group 'killing) Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 11:34:21 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 15:34:21 +0000 Received: from localhost ([127.0.0.1]:60570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slVXx-0007wm-BV for submit@debbugs.gnu.org; Tue, 03 Sep 2024 11:34:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slVXv-0007wX-59 for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 11:34:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slVWo-0005Bs-F2; Tue, 03 Sep 2024 11:33:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3FVC69qXFikixSpi4EdopipIK48wBs/R1F7DsTT4sYY=; b=Ah0PLVDoYV5v NoBN3LFuSCin8M2G8B8uiH4OwB6kxi3hb8nxQ+wXVgX5Q7gMyKA+e0mTqZBizCwfkMSyyZy8/2BEl TFy+Dl6668TsmeOxsi9BEZtnDjQtBoxeZ97f6U4X6Lux/4kak9dUpJ0J3aOalLK3QhjaMa72MAedO dqw0JADmow6mvzqsSj+HpEKiT62JsLo+6TCSo8UglYM8dq+vfLdPrQTa0IeXPNfYOXgFZcRPpAUNC 4kD+JfKb+fdsA6RhC/mpO+cun/2QfYhohgyrQK3MJHZnzQCqc/geKii4a7fuuT+xFyYmk/Oy3BkcY JJAxvm5NtIJKaDeAOkRGcg==; Date: Tue, 03 Sep 2024 18:32:55 +0300 Message-Id: <868qw87nx4.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87plpku6qm.fsf@gmail.com> (message from Robert Pluim on Tue, 03 Sep 2024 16:55:29 +0200) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <87ttewu9lo.fsf@gmail.com> <86bk147qxc.fsf@gnu.org> <87plpku6qm.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Robert Pluim > Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, > juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, > spwhitton@spwhitton.name > Date: Tue, 03 Sep 2024 16:55:29 +0200 > > +(defcustom kill-word-if-no-region nil > + "Behaviour when `kill-region' is invoked without an active region. > +If set to nil (default), then an error occurs and nothing is killed. If > +set to `emacs-word', then kill a the last word as defined by the current > +major mode. If set to `unix-word', then kill the last word in the style > +of a shell like Bash, disregarding the major mode. If set to a > +function, call that function." > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > + (const :tag "Kill a word like Bash would" unix-word) > + (const :tag "Do not kill anything" nil) > + (symbol :tag "User function") > + :group 'killing) When and why would this be useful? Since kill-region cannot be customized in this way, I wonder why this new functionality should. If someone wants to replace kill-region with their own function, they can always redefine it or advise it, no? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 12:34:03 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 16:34:03 +0000 Received: from localhost ([127.0.0.1]:60666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slWTi-0001Ao-RI for submit@debbugs.gnu.org; Tue, 03 Sep 2024 12:34:03 -0400 Received: from mout01.posteo.de ([185.67.36.65]:35957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slWTf-0001AD-Au for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 12:34:01 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 70101240027 for <69097@debbugs.gnu.org>; Tue, 3 Sep 2024 18:32:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725381169; bh=Lg5gr8Sk6UH1rPBZZgBk33rnH1N7w94OZs8uTbMJjEg=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=DgDQuDEPNLqHJ6xmjhmJXwg1w9bAnyPptxPfZH4+sNKHdM/q0PvjhTeQ4OpoAATtk AzKfOSB60HBdX9Btl5x3YhoCiuJRYWILuF8dIuvNPLCW5bXcYoJOL5bGjlnPYMcjzF +Z89YxujnRKBXdC7ppH016kE0KhZEo3Sal+MoJYgZZ7DQXTUvH+UtTsNWtbKV3MsOd /IH38/15POqXFgTel8+srzEmJVQZjoBwbYJyccWzwktTAIA9Lft8JoJUD0HFafRVbK CjAjRhy5vN8Zfr9I9w+UsBGLhTvJuWqDzAdd/Gfn1FLEKl/MrgTKY9eL0QZJmcsZ0K DYP/k0yrgdBQQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wyrl30fnSz9rxG; Tue, 3 Sep 2024 18:32:46 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86r0a16i71.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 03 Sep 2024 15:21:54 +0300") 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Tue, 03 Sep 2024 16:32:46 +0000 Message-ID: <877cbshf4h.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , Stefan Kangas , >> Andrea Corallo , juri@linkov.net, rms@gnu.org, >> 69097@debbugs.gnu.org >> Date: Mon, 02 Sep 2024 21:12:01 +0000 >> >> I had misremembered the last state of this patch. It is easier to just >> have a tristate option. Here is the updated proposal: > > Thanks. > >> +(defcustom kill-word-if-no-region nil > > I would call this 'kill-region-dwim' instead. Can do. >> + "Behaviour when `kill-region' is invoked without an active region. >> +If set to nil (default), then an error occurs and nothing is killed. If >> +set to `emacs-word', then kill a the last word as defined by the current >> +major mode. If set to `unix-word', then kill the last word in the style >> +of a shell like Bash, disregarding the major mode." >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) >> + (const :tag "Kill a word like Bash would" unix-word) >> + (const :tag "Do not kill anything" nil)) >> + :group 'killing) > > :version tag is missing. Whoops, added it. >> -Lisp programs should use this function for killing text. >> - (To delete text, use `delete-region'.) >> -Supply two arguments, character positions BEG and END indicating the >> - stretch of text to be killed. If the optional argument REGION is >> - non-nil, the function ignores BEG and END, and kills the current >> - region instead. Interactively, REGION is always non-nil, and so >> - this command always kills the current region." >> +Lisp programs should use this function for killing text. (To delete >> +text, use `delete-region'.) Supply two arguments, character positions >> +BEG and END indicating the stretch of text to be killed. If the >> +optional argument REGION is non-nil, the function ignores BEG and END, >> +and kills the current region instead. If REGION has the special value > > Not sure why you decided to reformat this part. Its formatting was > not random. I think this was just an accidental M-q. > This also needs a NEWS entry. I've added the NEWS entry from the last iteration of the patch (now actually as a patch, not just a diff): --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Allow-kill-region-kill-the-last-word-when-there-is-n.patch >From 981331cfe0757b21f529be02d848a3ef7bcc4295 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 3 Sep 2024 18:29:56 +0200 Subject: [PATCH] Allow 'kill-region' kill the last word when there is no region * etc/NEWS: Document the new user option. * lisp/simple.el (kill-region-dwim): Add new option. (kill-region): Respect 'kill-region-dwim'. (Bug#69097) --- etc/NEWS | 6 ++++++ lisp/simple.el | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1e66f084117..7fadf52a6cf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,12 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. +--- +** New user option 'kill-word-if-no-region'. +This option will modify the fall-back behaviour of 'kill-region' if no +region is active, and will kill the last word instead of raising an +error. + * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index eedc5768fe2..3b4453c7a8f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5817,6 +5817,17 @@ kill-read-only-ok :type 'boolean :group 'killing) +(defcustom kill-region-dwim nil + "Behaviour when `kill-region' is invoked without an active region. +If set to nil (default), then an error occurs and nothing is killed. If +set to `emacs-word', then kill a the last word as defined by the current +major mode. If set to `unix-word', then kill the last word in the style +of a shell like Bash, disregarding the major mode." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil)) + :group 'killing) + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5843,21 +5854,44 @@ kill-region (To delete text, use `delete-region'.) Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current + `region', the function ignores BEG and END, and kills the current region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." + this command always kills the current region. It is possible to + override this behaviour by customising the user option + `kill-region-dwim'." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) - (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + (cond + ((and beg end (use-region-p)) + (list beg end 'region)) + (kill-region-dwim + (list beg end kill-region-dwim)) + ((user-error "The mark is not set now, so there is no region")))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((eq region 'emacs-word) + (let ((end (point))) + (save-excursion + (forward-word -1) + (filter-buffer-substring (point) end 'delete)))) + ((eq region 'unix-word) + (let ((end (point))) + (save-excursion + (skip-chars-backward "[:space:]") + (skip-chars-backward "^[:space:]") + (filter-buffer-substring + (if (get-char-property (point) 'read-only) + (next-single-char-property-change + (point) 'read-only nil end) + (point)) + end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) -- 2.46.0 --=-=-= Content-Type: text/plain Robert Pluim writes: >>>>>> On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: > > >> From: Philip Kaludercic > >> Cc: Eli Zaretskii , Stefan Kangas , > >> Andrea Corallo , juri@linkov.net, rms@gnu.org, > >> 69097@debbugs.gnu.org > >> Date: Mon, 02 Sep 2024 21:12:01 +0000 > >> > >> I had misremembered the last state of this patch. It is easier to just > >> have a tristate option. Here is the updated proposal: > > Eli> Thanks. > > >> +(defcustom kill-word-if-no-region nil > > Eli> I would call this 'kill-region-dwim' instead. > > >> + "Behaviour when `kill-region' is invoked without an active region. > >> +If set to nil (default), then an error occurs and nothing is killed. If > >> +set to `emacs-word', then kill a the last word as defined by the current > >> +major mode. If set to `unix-word', then kill the last word in the style > >> +of a shell like Bash, disregarding the major mode." > >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > >> + (const :tag "Kill a word like Bash would" unix-word) > >> + (const :tag "Do not kill anything" nil)) > >> + :group 'killing) > > Eli> :version tag is missing. > > Is it worth allowing a user-specified function? That would be possible as well, but to make it manageable with the current approach the function would have to be one that moves the point. So we could rewrite the patch with two default options `backward-word' and `unix-backward-word' (which we would have to add), but I am not sure it would have much use. Perhaps killing the current word, instead of just killing to the beginning? > Robert -- Philip Kaludercic on peregrine --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 03 12:49:23 2024 Received: (at 69097) by debbugs.gnu.org; 3 Sep 2024 16:49:23 +0000 Received: from localhost ([127.0.0.1]:60749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slWiZ-0001cE-75 for submit@debbugs.gnu.org; Tue, 03 Sep 2024 12:49:23 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:42185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slWiX-0001bq-0I for 69097@debbugs.gnu.org; Tue, 03 Sep 2024 12:49:21 -0400 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-374bfc395a5so1904988f8f.0 for <69097@debbugs.gnu.org>; Tue, 03 Sep 2024 09:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725382033; x=1725986833; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2C/AC+GhufNkZR92BommtQnMXbmOD7GT2aCVLOi3lVA=; b=fy8wI/aQqlA558eE2oZVyPhL4jih8p6/4vSxKKNr6U6MnUzdIOadP6o1vKcjtpQkB5 +MUXPjVIzGqW+9oup82iX7lnxKkzsUR5patWrbr9/0FWL7gT+Z18yunlmMMstiQBXnub JNSdBAwsB98xGGm7N8xJCBIeq9XKB+buVmZ3XTey6Qt9cHMfTdb7ZTyhNt6Iy+vZOirJ DLCWl6BJ0IVHiLDgp7NloLNKa2wAX8kUMoYqN8FG79ASr+IMGC7zRH14oTB9nsHzlxJy 2YWvNvMTuAFqoEn7QjOEiN5Ge8foQ/yuQ0yep7/w1VcotFwBHYEmPa6lc8fyWiGCt+38 kbOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725382033; x=1725986833; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2C/AC+GhufNkZR92BommtQnMXbmOD7GT2aCVLOi3lVA=; b=dCRg4t8Gga966x68FWZQ0E9uV4gGonRTrC8NbuirObateADvX01ZpeK40l9JhEJHY4 0ZV2waOuB6CyvSszO/5kP/Du7jVhNTJ6pk+5H+B9a5eQ5jlWHP7IcXI5lqtkvhiYLnpZ ZneuqCW/BN/wDQlidNYf1sO31pA3salh5M9i0+UNl9/SsxlvhmDqGaUX/779oV5By4ur xa/CQ4nLnKfdCOwS/ngiEFfFCtHO3jYLUP79K88heXcmODBONkaSK4q40jcDyKKcaW1X SlDncB7sayKsGpa1Ubx3RlQ1/dGcUoAYwxu3JUPXKR60TrhY55vzs7lGDXyf/HdJAsJY SXcQ== X-Forwarded-Encrypted: i=1; AJvYcCVolOTE3afj8OPQqExw5xSNiu44qkYU6Aj/XDgt8OATVE2tIeWePIAUn/Em4HtWnXjjc8lXmA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwFnpw+UDKWPGW7eUjPT2dq5pEPkMnJKXi+woJ5s3EbVOxCICY1 Tv9sfbUYlclMb5U359g1KZM1Zgh6OxG2BZDp4if4pQDB9kkeHxnO X-Google-Smtp-Source: AGHT+IGQGtFgoJZld6Ry/EuuRLotEtVHVUFztyj9mbuHZHLCifTf4wdDi9vicxVf4WRozO77MKzf8g== X-Received: by 2002:a5d:5e12:0:b0:374:badf:3017 with SMTP id ffacd0b85a97d-374badf30e9mr5684660f8f.33.1725382032339; Tue, 03 Sep 2024 09:47:12 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:c8aa:69e8:c66e:716f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ee71616sm14821922f8f.31.2024.09.03.09.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 09:47:11 -0700 (PDT) From: Robert Pluim To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <877cbshf4h.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 03 Sep 2024 16:32:46 +0000") References: <871q9g8z8k.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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> Date: Tue, 03 Sep 2024 18:47:10 +0200 Message-ID: <87le08u1kh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 03 Sep 2024 16:32:46 +0000, Philip Kaludercic said: >>=20 >> Is it worth allowing a user-specified function? Philip> That would be possible as well, but to make it manageable with = the Philip> current approach the function would have to be one that moves t= he point. Philip> So we could rewrite the patch with two default options `backwar= d-word' Philip> and `unix-backward-word' (which we would have to add), but I am= not sure Philip> it would have much use. Perhaps killing the current word, inst= ead of Philip> just killing to the beginning? You mean having all the option values be functions? That would work as well, but was not what I was suggesting. In any case, I can=CA=BCt find a strong justification for such configurability. We can always add it in later if people ask for it. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 04 07:10:19 2024 Received: (at 69097) by debbugs.gnu.org; 4 Sep 2024 11:10:19 +0000 Received: from localhost ([127.0.0.1]:33677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slntz-0005p0-DK for submit@debbugs.gnu.org; Wed, 04 Sep 2024 07:10:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slntw-0005om-OE for 69097@debbugs.gnu.org; Wed, 04 Sep 2024 07:10:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slnsm-0003SG-7Q; Wed, 04 Sep 2024 07:09:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=G3giOVFCvJh7XoXaxKlM1kDm2859CZ+ErmDxubeB70w=; b=Kkr5DnGaPfRu VvTxg5fxIlHFsbUeJXuinsaiKh19puaEUUPR9PdSYlMQJKH5kFXlt9W6hRwurleQ6POyWsuCbCTMf H2Sa+uHi/IidhtG0+X+sOd+gtcQhDehixrwuuUFEtc8weIUyOz6XwrL8Cug0FdtyfDqn2LMfhfnzP rw8/deVRFxnLdh8s8yW3KAPsB3I/AGjc2kEcRrHluChywrfLz1Y6+2ekrflxyhXSSKF1Q+ubsY1w4 /xhJ8KlXeKSITB2PuJiGUbSEt4ZAU4JUfHXERkK0QbmwwMRSgD5PL1nTOUzo0FMym/q9Xak2CrvtM isP66NK8y4nnafcEafTT7A==; Date: Wed, 04 Sep 2024 14:08:51 +0300 Message-Id: <86zfon65h8.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <877cbshf4h.fsf@posteo.net> (message from Philip Kaludercic on Tue, 03 Sep 2024 16:32:46 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command 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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > From: Philip Kaludercic > Cc: spwhitton@spwhitton.name, stefankangas@gmail.com, acorallo@gnu.org, > juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Tue, 03 Sep 2024 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [209.51.188.92 listed in zen.spamhaus.org] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.92 listed in list.dnswl.org] X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > From: Philip Kaludercic > Cc: spwhitton@spwhitton.name, stefankangas@gmail.com, acorallo@gnu.org, > juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Tue, 03 Sep 2024 16:32:46 +0000 > > I've added the NEWS entry from the last iteration of the patch (now > actually as a patch, not just a diff): Thanks. > +--- > +** New user option 'kill-word-if-no-region'. ^^^^^^^^^^^^^^^^^^^^^^ This is not the right name... > +(defcustom kill-region-dwim nil > + "Behaviour when `kill-region' is invoked without an active region. > +If set to nil (default), then an error occurs and nothing is killed. If > +set to `emacs-word', then kill a the last word as defined by the current ^^^^^^^^^^ The "a" part should be removed. > +major mode. If set to `unix-word', then kill the last word in the style > +of a shell like Bash, disregarding the major mode." > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > + (const :tag "Kill a word like Bash would" unix-word) > + (const :tag "Do not kill anything" nil)) > + :group 'killing) :version still missing. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 04 10:08:54 2024 Received: (at 69097) by debbugs.gnu.org; 4 Sep 2024 14:08:54 +0000 Received: from localhost ([127.0.0.1]:35080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slqgn-0002xu-Po for submit@debbugs.gnu.org; Wed, 04 Sep 2024 10:08:54 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:37754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slqgl-0002xa-Cb for 69097@debbugs.gnu.org; Wed, 04 Sep 2024 10:08:52 -0400 DKIM-Signature: a=rsa-sha256; b=Z8zOatKTcZdP4u0w5VAMsJHsge3NJoFNiFffi2Tb6k9wnUwB4OhV0SJP4grFbF/SSwI2G3Qf4LfSEzv+3AQFSZ2b+g6aFzunhsuVrQP/xiTpTINsDL+4x18WSctiugvGh8nf8Rjk+qEVHI5mWX/A9Pe/KbOPYet5PXL4LvuYBLnuPV07MXHfp7YlRFXY0+M1Tf6Qty409mzi1PoCDvh1jqC2p1knJAdinYiJlbtxY6qgGya15M80efy2QUMjIJdzlkaoKszKMAkVc2LtMUOUMVSOp87CEnNh4jeO5SDmsxDFEt6RKIhDGROl1EHRqN0W5FPs0Nzxjs7ySC7KhF457w==; s=purelymail1; d=spwhitton.name; v=1; bh=QKQQx9lOjTz1gLQ/R0hpWqGcL1jsa1koXE647j1bHAE=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Us+M9EwqC9YHHRJwq1PxVZ+8wBi+/2JFLD6vMA0RwGCf0roKoL84cc+9WLnJA2ZrjKCV2erYDsFu1d4BT/uxQdyCEs+1RIV4l5V9knH4YKV4tT+na2r6vyYLkzOIZgKLZ05irhXKuVWomzpQq50HSkwjRsZ1ey69GZYFZ+D3xCziwvFJ7L146Oog0JRRZ7ZS4yg8QcwzQwSmu9+W/eWNQrpsx6i/cov8pxGTnUY2XR0Mq6Us/y94eNuVlDWARXgAdQ/hT3LDeeuNpiUvhhuZml02xjV7tSU6p07yU9NI9MudfzTSIgyL+KJVhwDyaqMi8XuE0S6nFAbEG3TD9I5v/g==; s=purelymail1; d=purelymail.com; v=1; bh=QKQQx9lOjTz1gLQ/R0hpWqGcL1jsa1koXE647j1bHAE=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1736106325; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 04 Sep 2024 14:07:09 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 0A165949A07; Wed, 4 Sep 2024 15:07:08 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <877cbshf4h.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 03 Sep 2024 16:32:46 +0000") References: <871q9g8z8k.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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> Date: Wed, 04 Sep 2024 15:07:08 +0100 Message-ID: <87a5gnzf5f.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Tue 03 Sep 2024 at 04:32pm GMT, Philip Kaludercic wrote: > > +(defcustom kill-region-dwim nil > + "Behaviour when `kill-region' is invoked without an active region. > +If set to nil (default), then an error occurs and nothing is killed. If > +set to `emacs-word', then kill a the last word as defined by the current > +major mode. If set to `unix-word', then kill the last word in the style > +of a shell like Bash, disregarding the major mode." > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > + (const :tag "Kill a word like Bash would" unix-word) > + (const :tag "Do not kill anything" nil)) > + :group 'killing) I think I'm missing something here. When it's nil and there is no *active* region, but there is a region, it should kill that, surely? With or without TMM. I very regularly kill inactive regions (e.g. after M->). > + ((eq region 'unix-word) > + (let ((end (point))) > + (save-excursion > + (skip-chars-backward "[:space:]") > + (skip-chars-backward "^[:space:]") > + (filter-buffer-substring > + (if (get-char-property (point) 'read-only) > + (next-single-char-property-change > + (point) 'read-only nil end) > + (point)) > + end 'delete)))) > + (region > + (funcall region-extract-function 'delete)) > + ((filter-buffer-substring beg end 'delete))))) Shall I rather commit this as an independent unix-word-rubout? Improves attribution, and it's independently useful. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 04 10:23:23 2024 Received: (at 69097) by debbugs.gnu.org; 4 Sep 2024 14:23:23 +0000 Received: from localhost ([127.0.0.1]:35127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slquo-0003SF-UF for submit@debbugs.gnu.org; Wed, 04 Sep 2024 10:23:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1slqun-0003S3-0C for 69097@debbugs.gnu.org; Wed, 04 Sep 2024 10:23:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slqtX-00078K-QL; Wed, 04 Sep 2024 10:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tq24oaCnROAscIqLjTRv79r9jnpGCbPa+4Qp8ViTKow=; b=Xj4JnbXVTAEf WuN5bGeA2+2UGI+iJsQjwyh7SA0elzJfiRzN10JLsuyranOEs44pVKZ6yNR/bpYKF9scmywo+jvn8 wiwOX0TKLDkoAOFmj4uzYpVbzWDWOjpm3OJR9O4EFJontapYQCYxWITI+4q9rSszWyhVWIM1Zg+es mSkPrGqEO9b6BtQsfWxl5sKWE/mQcJjSR9o8yRLXMAMyNzey5AcSVNvcgrsoyGr2QhsopHT2ffqn4 KrvXGawFZz/ucguX2CgUkGlCpJgLqy2yZWh1kTt3ekoH04ru4PGcgE2WQCdqKmuabkLQr+s/eb9a1 uNjQjc6UiiC5LoLPPS1CCw==; Date: Wed, 04 Sep 2024 17:21:52 +0300 Message-Id: <86cylj5wjj.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87a5gnzf5f.fsf@zephyr.silentflame.com> (message from Sean Whitton on Wed, 04 Sep 2024 15:07:08 +0100) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > From: Sean Whitton > Cc: Eli Zaretskii , stefankangas@gmail.com, > acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Wed, 04 Sep [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [209.51.188.92 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.92 listed in list.dnswl.org] X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > From: Sean Whitton > Cc: Eli Zaretskii , stefankangas@gmail.com, > acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Wed, 04 Sep 2024 15:07:08 +0100 > > > +(defcustom kill-region-dwim nil > > + "Behaviour when `kill-region' is invoked without an active region. > > +If set to nil (default), then an error occurs and nothing is killed. If > > +set to `emacs-word', then kill a the last word as defined by the current > > +major mode. If set to `unix-word', then kill the last word in the style > > +of a shell like Bash, disregarding the major mode." > > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > > + (const :tag "Kill a word like Bash would" unix-word) > > + (const :tag "Do not kill anything" nil)) > > + :group 'killing) > > I think I'm missing something here. When it's nil and there is no > *active* region, but there is a region, it should kill that, surely? > With or without TMM. Yes, you are right. It sounds like we made wrong assumptions about what happens in that case, and should rethink this. C-w signals an error only if there's no mark in the buffer. So I guess we need a new command after all. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 05:40:48 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 09:40:48 +0000 Received: from localhost ([127.0.0.1]:36192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm8yu-0000Ob-6l for submit@debbugs.gnu.org; Thu, 05 Sep 2024 05:40:48 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm8yr-0000O1-M7 for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 05:40:46 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2CAA5240028 for <69097@debbugs.gnu.org>; Thu, 5 Sep 2024 11:39:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725529175; bh=5CfZoQsV1TsK6yxeKga2EwTzex6mLt9B0ASH0mWHMC0=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=M8yT6qZ8Kbs6IghvuZIfpARY7bI16I1SEW/5Fi12B02E9GAHJQfES6nR9h94dMfBI YCmIVJqn7csGqh9/z9Ha6aID01xhx6W8cJSrz7ix6fM7uT61GDCTXRLfpz1CwB+Bpp 5YRem8WAZNJYMH4ZMGAY+oHFI0sQtq2DvCSxoNJzgYKw0LeshYdtBPTHezRu59ek2t ND5QoxgIeglWeEC6g8Sl/gigKvUg7sLixtE91illDDlJGy/eHD8/HyfNdYN96EjT9t 3X9rZfjfbiLGtwuVgJ1BjGfMiWdYc2dQbQ/PcI2XPyMVFEbUeVOqjrJAsI1bUmQtD6 tkOzTWIPGahYQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WzvTK5HGTz6tm8; Thu, 5 Sep 2024 11:39:33 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87a5gnzf5f.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Wed, 04 Sep 2024 15:07:08 +0100") References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Thu, 05 Sep 2024 09:39:32 +0000 Message-ID: <87y146jv6z.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Sean Whitton writes: > Hello, > > On Tue 03 Sep 2024 at 04:32pm GMT, Philip Kaludercic wrote: > >> >> +(defcustom kill-region-dwim nil >> + "Behaviour when `kill-region' is invoked without an active region. >> +If set to nil (default), then an error occurs and nothing is killed. If >> +set to `emacs-word', then kill a the last word as defined by the current >> +major mode. If set to `unix-word', then kill the last word in the style >> +of a shell like Bash, disregarding the major mode." >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) >> + (const :tag "Kill a word like Bash would" unix-word) >> + (const :tag "Do not kill anything" nil)) >> + :group 'killing) > > I think I'm missing something here. When it's nil and there is no > *active* region, but there is a region, it should kill that, surely? > With or without TMM. > I very regularly kill inactive regions (e.g. after M->). That is not an inherent problem, we can adjust the patch by --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/simple.el b/lisp/simple.el index 3b4453c7a8f..9d4d5bcd10c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5865,11 +5865,11 @@ kill-region (let ((beg (mark)) (end (point))) (cond - ((and beg end (use-region-p)) - (list beg end 'region)) - (kill-region-dwim + ((and kill-region-dwim (not (use-region-p))) (list beg end kill-region-dwim)) - ((user-error "The mark is not set now, so there is no region")))))) + ((not (or beg end)) + (user-error "The mark is not set now, so there is no region")) + ((list beg end 'region)))))) (condition-case nil (let ((string (cond --=-=-= Content-Type: text/plain to fix that issue. >> + ((eq region 'unix-word) >> + (let ((end (point))) >> + (save-excursion >> + (skip-chars-backward "[:space:]") >> + (skip-chars-backward "^[:space:]") >> + (filter-buffer-substring >> + (if (get-char-property (point) 'read-only) >> + (next-single-char-property-change >> + (point) 'read-only nil end) >> + (point)) >> + end 'delete)))) >> + (region >> + (funcall region-extract-function 'delete)) >> + ((filter-buffer-substring beg end 'delete))))) > > Shall I rather commit this as an independent unix-word-rubout? > > Improves attribution, and it's independently useful. As a standalone command? Eli Zaretskii writes: >> From: Sean Whitton >> Cc: Eli Zaretskii , stefankangas@gmail.com, >> acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org >> Date: Wed, 04 Sep 2024 15:07:08 +0100 >> >> > +(defcustom kill-region-dwim nil >> > + "Behaviour when `kill-region' is invoked without an active region. >> > +If set to nil (default), then an error occurs and nothing is killed. If >> > +set to `emacs-word', then kill a the last word as defined by the current >> > +major mode. If set to `unix-word', then kill the last word in the style >> > +of a shell like Bash, disregarding the major mode." >> > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) >> > + (const :tag "Kill a word like Bash would" unix-word) >> > + (const :tag "Do not kill anything" nil)) >> > + :group 'killing) >> >> I think I'm missing something here. When it's nil and there is no >> *active* region, but there is a region, it should kill that, surely? >> With or without TMM. > > Yes, you are right. It sounds like we made wrong assumptions about > what happens in that case, and should rethink this. > > C-w signals an error only if there's no mark in the buffer. > > So I guess we need a new command after all. Not necessarily (unless I am mistaken above), but I am not opposed to it either. -- Philip Kaludercic on siskin --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 06:01:04 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 10:01:05 +0000 Received: from localhost ([127.0.0.1]:36219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9IW-0001y4-Ic for submit@debbugs.gnu.org; Thu, 05 Sep 2024 06:01:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9IV-0001wn-09 for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 06:01:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sm9Aa-000736-FO; Thu, 05 Sep 2024 05:52:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=05jKGADTVnypklFHPrUxaFCHkJtMjPZgGTKLaQu6TAw=; b=c9TGU9Nxt6mA Zw0UY0O58l76dUrPZ8Qasaop+gL3E8ekvPTPPLdq5XfwErcKPk72TqS/Z+J34+VUEKHNeuI3QRsqK skGIjA5hgYDgawnVVav3sgGx9182mZk56EviAOfLBg6LARRV5P8BFYRs8w+gysYkZ4UE4nz7EX3ot 92PcgedvhXaeI6m9yBrRjtQ3hEgFfD0gCTTrfypbTEinP1N0Gd23Nw9D/bHNWS/vE8oO0T8szws2U QHUZ2dwRA9jnRbJ3rqW9tcBLmm86Vfz5KDrFJ8pu1NMDtIHH9tOLdUxb4JJdDVBiZ0pefpyvS/xXU kerBruDxtec7EMWlw4UKdQ==; Date: Thu, 05 Sep 2024 12:52:40 +0300 Message-Id: <86a5gm4ec7.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87y146jv6z.fsf@posteo.net> (message from Philip Kaludercic on Thu, 05 Sep 2024 09:39:32 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: Eli Zaretskii , stefankangas@gmail.com, > acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Thu, 05 Sep 2024 09:39:32 +0000 > > >> I think I'm missing something here. When it's nil and there is no > >> *active* region, but there is a region, it should kill that, surely? > >> With or without TMM. > > > > Yes, you are right. It sounds like we made wrong assumptions about > > what happens in that case, and should rethink this. > > > > C-w signals an error only if there's no mark in the buffer. > > > > So I guess we need a new command after all. > > Not necessarily (unless I am mistaken above), but I am not opposed to it either. If we don't introduce a new command, then what will be the modified behavior of kill-region? Specifically, when will it delete the last word? In Emacs buffers, it is very rare not to have the mark, so it sounds like the Bash-like behavior will very rarely if ever available, no? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 06:04:00 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 10:04:01 +0000 Received: from localhost ([127.0.0.1]:36228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9LM-0002Ek-IM for submit@debbugs.gnu.org; Thu, 05 Sep 2024 06:04:00 -0400 Received: from mout01.posteo.de ([185.67.36.65]:53879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9LK-0002ED-Re for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 06:03:59 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 50C43240027 for <69097@debbugs.gnu.org>; Thu, 5 Sep 2024 12:02:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725530568; bh=GJ+6gcV4iiQS9587hY45/SPTvYbyFJh/dMIxMdCs4pw=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=DII+UpJPe+zJyHImU1VXHbccAjtW94H1tuBmhEbx0qp3CP8y6UwmT7s3m0cHuCbbu Wk7FIS8HAu+/BxuoMj9tA9kpXHLmNON+RLTlsOa+pPjGAdfok9yLTAD+ba93+PPNlI uQ+ygbNfPsN2qor/EoU3jHL6TRgr8XmPEyA56r3l4NnqF3H7ctRrh5u0hH5+HWTLwu VX3EjBJ1sHa5wVzVI/84KlBIOPR+ToLZFvlB/eqS5hCUcErMeWRMhnJZSbuj94Qwdr HaV/FnqbrcTYWSlGqXLeYf6mSItEzEXmDywvfaYOL+2nw/FiSlNpLnsJlGXn0mCiad jE09Q50MRBxUA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wzw06507hz9rxL; Thu, 5 Sep 2024 12:02:46 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86a5gm4ec7.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Sep 2024 12:52:40 +0300") References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <86a5gm4ec7.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Thu, 05 Sep 2024 10:02:45 +0000 Message-ID: <87o752ju4a.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , stefankangas@gmail.com, >> acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org >> Date: Thu, 05 Sep 2024 09:39:32 +0000 >> >> >> I think I'm missing something here. When it's nil and there is no >> >> *active* region, but there is a region, it should kill that, surely? >> >> With or without TMM. >> > >> > Yes, you are right. It sounds like we made wrong assumptions about >> > what happens in that case, and should rethink this. >> > >> > C-w signals an error only if there's no mark in the buffer. >> > >> > So I guess we need a new command after all. >> >> Not necessarily (unless I am mistaken above), but I am not opposed to it either. > > If we don't introduce a new command, then what will be the modified > behavior of kill-region? Specifically, when will it delete the last > word? If the new user option is non-nil /and/ there is no region. If `kill-region-dwim' is nil (default), then nothing should change. > > In Emacs buffers, it is very rare not to have the mark, so it > sounds like the Bash-like behavior will very rarely if ever available, > no? It will kick-in whenever `use-region-p' returns a non-nil value. I recognise that this isn't useful for people who don't rely on transient mark mode, but in that case we'll need to commands anyway, as I don't want to use the behaviour that Sean describes. -- Philip Kaludercic on siskin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 06:20:59 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 10:21:00 +0000 Received: from localhost ([127.0.0.1]:36241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9bn-0003Td-EC for submit@debbugs.gnu.org; Thu, 05 Sep 2024 06:20:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9bk-0003Sw-QA for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 06:20:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sm9ab-0004rV-TH; Thu, 05 Sep 2024 06:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3SqDM8dtUuQ1xFpoYjG4XnWxxY+yvPxAP5SdO6fiSwg=; b=JOJQUBgH46g0 UKm9mw0zrC8GTQ6zgFC1FshC0ucY5Fui6DfXoHMYUdSlFT/0T5BUA3F/TU1yok3uV/0QoCllHvQAV 5KiHIgSlDNuhXDz4pPp3YL20di2cSlUpApXfj9TyN8OvWReN9tD5US9IMx+Uql6/cHXP/yZ7znjhx eVoVNHrW48kkjMrc55S/IU8tFSp2q/jZbFMOJa4RJjoVU1eNEMvBxyhZ9+AO6ngfMcjeQa03aRvHl QmgFPfaxmXXHYaCBb6pIaJQdBKGzdrywFSXI2pcOUN3qZ1oYVDhBgV1a1YBqXcoxdd270XyOFZjXC LhboOl1jM19DRwNu2bk35g==; Date: Thu, 05 Sep 2024 13:19:33 +0300 Message-Id: <868qw64d3e.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87o752ju4a.fsf@posteo.net> (message from Philip Kaludercic on Thu, 05 Sep 2024 10:02:45 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <86a5gm4ec7.fsf@gnu.org> <87o752ju4a.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: spwhitton@spwhitton.name, stefankangas@gmail.com, acorallo@gnu.org, > juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Thu, 05 Sep 2024 10:02:45 +0000 > > Eli Zaretskii writes: > > > If we don't introduce a new command, then what will be the modified > > behavior of kill-region? Specifically, when will it delete the last > > word? > > If the new user option is non-nil /and/ there is no region. If > `kill-region-dwim' is nil (default), then nothing should change. > > > > > In Emacs buffers, it is very rare not to have the mark, so it > > sounds like the Bash-like behavior will very rarely if ever available, > > no? > > It will kick-in whenever `use-region-p' returns a non-nil value. Non-nil or nil? Above you say "there's no region", which AFAIU means use-region-p returns nil. > I recognise that this isn't useful for people who don't rely on > transient mark mode, but in that case we'll need to commands anyway, > as I don't want to use the behaviour that Sean describes. Which is why I think we will need a separate command after all. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 06:30:16 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 10:30:16 +0000 Received: from localhost ([127.0.0.1]:36248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9kl-0004Dv-O8 for submit@debbugs.gnu.org; Thu, 05 Sep 2024 06:30:16 -0400 Received: from mout02.posteo.de ([185.67.36.66]:51051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sm9kj-0004CR-VL for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 06:30:14 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id AA85A240103 for <69097@debbugs.gnu.org>; Thu, 5 Sep 2024 12:23:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725531806; bh=dFEKADzELtv/Rd/7mO7T7Hy5CZv6diKq5OibSTBO1lk=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=CmRZLpaYu6IRW5AIGPOZZwETuC+1ri12kzkljqiY7rds52CexTAB70bHcWE7fhMhh zetHhOLEAolASDHlEkH3q3tmhMgrWKdjvB/qTrRy2HjjWapeWwbjb0L5U+EccYFnJF meolG6uuy8LjLirFbkHjamKQw2fd78zfJcLpXXfbmShAO1iHYRoc82etyR646McBnY rmntLPjpergJwSavWcXpTnrxb3xSCYQw9Oh2r2JNkS1AXMbKppwk8eLMqIrpi4zUEI 1J0cAFGQPpPCZlN5mc3Fjs8XdCCNSS+Twfnw4fK5Up2JEGAT1motN4SOrfuXOZVOqG +mzP1Bs5aIvlg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WzwRx280hz6twG; Thu, 5 Sep 2024 12:23:24 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <868qw64d3e.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Sep 2024 13:19:33 +0300") References: <871q9g8z8k.fsf@posteo.net> <864jbeixkt.fsf@gnu.org> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <86a5gm4ec7.fsf@gnu.org> <87o752ju4a.fsf@posteo.net> <868qw64d3e.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Thu, 05 Sep 2024 10:23:24 +0000 Message-ID: <87a5gmjt5v.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: spwhitton@spwhitton.name, stefankangas@gmail.com, acorallo@gnu.org, >> juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org >> Date: Thu, 05 Sep 2024 10:02:45 +0000 >> >> Eli Zaretskii writes: >> >> > If we don't introduce a new command, then what will be the modified >> > behavior of kill-region? Specifically, when will it delete the last >> > word? >> >> If the new user option is non-nil /and/ there is no region. If >> `kill-region-dwim' is nil (default), then nothing should change. >> >> > >> > In Emacs buffers, it is very rare not to have the mark, so it >> > sounds like the Bash-like behavior will very rarely if ever available, >> > no? >> >> It will kick-in whenever `use-region-p' returns a non-nil value. > > Non-nil or nil? Above you say "there's no region", which AFAIU means > use-region-p returns nil. Right, my bad. >> I recognise that this isn't useful for people who don't rely on >> transient mark mode, but in that case we'll need to commands anyway, >> as I don't want to use the behaviour that Sean describes. > > Which is why I think we will need a separate command after all. OK, but we can add that independently of this patch. -- Philip Kaludercic on siskin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 09:29:12 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 13:29:12 +0000 Received: from localhost ([127.0.0.1]:36428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smCXw-00014i-B1 for submit@debbugs.gnu.org; Thu, 05 Sep 2024 09:29:12 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:57240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smCXv-00014R-8Q for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 09:29:11 -0400 DKIM-Signature: a=rsa-sha256; b=swTuZlgY1uMK3Fg/PNO1oe+cU147GNPh0WiOvMiwlWhHaKD8VDAvQOMdo+YBrVWx112EMGQqRoyE7qs+fkutPml/fzKCWABehPg/tMBvIG7+xIiz2+/kSxQpnC3eCDTYs4qMiED0aNUIalESTJjT2EiNiTIJACwOZTesTfKV6EvAEeqfrs6sRvobdB+2pOPWZqz8lfBVT1hg0VtBeYn/Qqm1A7NtkY+HO3twGpL6Rh32VivrRXJKUQZ6T/jbvpH77ch33nQ1+PQx4rGHLjVisVcrGwGNk+o2wPk+VBpTLzFzplhakIGMAQMekfS+EUl7hRhTY+C6nGyHqpdKlqkZyA==; s=purelymail1; d=spwhitton.name; v=1; bh=qbmp16oRKnZApcctOUbgLhRJFI8Kf2jPyMGqo+EVkLE=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=a9bloj4hQQMrjjK3R72acXC6fxQF8fhGQA/VUsdts7IAszMeNnZIYtIlLf6WTEz7Jg6nEI014kYn4YYniqr8JvY04wkz+x6BL/96S5AJbYvXbcRezhaKi0QqKT/ziiHnjtqYk7gx8wrV+z85fZqZQYsu+miQMXjKs0SAeLbRf14GPkBxrXuj7L9P/84xpUNCDtHGdFahTsBKpJ1TsO1If6LEcV/cMMEfFFEi+jsPPCK3ctzz7FfjQqsvhPjZTZwTuxg0CFuGHSFUNhDkS6bKFC1iVklTsl7r/Lra1E8Qw/SgEqrnwgnN3JQQKejBNMK+GTjjHMypuI6PlZpH+9wQAQ==; s=purelymail1; d=purelymail.com; v=1; bh=qbmp16oRKnZApcctOUbgLhRJFI8Kf2jPyMGqo+EVkLE=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 238572978; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 05 Sep 2024 13:27:26 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 2CDA0949E3A; Thu, 5 Sep 2024 14:27:25 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87y146jv6z.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 05 Sep 2024 09:39:32 +0000") References: <871q9g8z8k.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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> Date: Thu, 05 Sep 2024 14:27:25 +0100 Message-ID: <87ikvaxmbm.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Thu 05 Sep 2024 at 09:39am GMT, Philip Kaludercic wrote: >>> + ((eq region 'unix-word) >>> + (let ((end (point))) >>> + (save-excursion >>> + (skip-chars-backward "[:space:]") >>> + (skip-chars-backward "^[:space:]") >>> + (filter-buffer-substring >>> + (if (get-char-property (point) 'read-only) >>> + (next-single-char-property-change >>> + (point) 'read-only nil end) >>> + (point)) >>> + end 'delete)))) >>> + (region >>> + (funcall region-extract-function 'delete)) >>> + ((filter-buffer-substring beg end 'delete))))) >> >> Shall I rather commit this as an independent unix-word-rubout? >> >> Improves attribution, and it's independently useful. > > As a standalone command? I mean, yeah, I have had it on my C-w for years. Probably some other people have implementations too. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 10:45:34 2024 Received: (at 69097) by debbugs.gnu.org; 5 Sep 2024 14:45:34 +0000 Received: from localhost ([127.0.0.1]:37807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smDjq-00079R-2m for submit@debbugs.gnu.org; Thu, 05 Sep 2024 10:45:34 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smDjn-00079B-NC for 69097@debbugs.gnu.org; Thu, 05 Sep 2024 10:45:32 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0C3E0240027 for <69097@debbugs.gnu.org>; Thu, 5 Sep 2024 16:38:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725547139; bh=w5HgHPHzozHDwukscBaaGNubeY37s92+3AwQ8zBrv68=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=VwgmvJwNWWtokHD5NhGACpokhpEVMfBMlsCCl5ntFZzMkyEpzbdI+uT2oCMBTc+XH iXdUGG0r4sOwb8my7wUAXHyZAgvS2Sgd2GlSj7g5Qz1ezKRplEqhj7Qve8Wc5937+6 a6oSv9mAlaqlvL4HdLAb7Zgv3ITqAPr8q0c9jErZQmSEzk8Zi5LlAZqniv4qL6hfhf O3CjKIvu3Ni/vGyu0ZvX0wv4TF6xZnehTFNzwgs1HnKg+OKpgFVCWdFpApocsBYjNk VN56vr7fgv9YMk/EExJ8cD6DcIVH+n74oO8uarnC5EdlZcDEbb8CeHJUnUSDzTyIcy elpUm4CO5YhLQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X026n3nJ7z6twj; Thu, 5 Sep 2024 16:38:57 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87ikvaxmbm.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Thu, 05 Sep 2024 14:27:25 +0100") References: <871q9g8z8k.fsf@posteo.net> <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> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Thu, 05 Sep 2024 14:38:56 +0000 Message-ID: <871q1yw4fz.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Sean Whitton writes: > Hello, > > On Thu 05 Sep 2024 at 09:39am GMT, Philip Kaludercic wrote: > >>>> + ((eq region 'unix-word) >>>> + (let ((end (point))) >>>> + (save-excursion >>>> + (skip-chars-backward "[:space:]") >>>> + (skip-chars-backward "^[:space:]") >>>> + (filter-buffer-substring >>>> + (if (get-char-property (point) 'read-only) >>>> + (next-single-char-property-change >>>> + (point) 'read-only nil end) >>>> + (point)) >>>> + end 'delete)))) >>>> + (region >>>> + (funcall region-extract-function 'delete)) >>>> + ((filter-buffer-substring beg end 'delete))))) >>> >>> Shall I rather commit this as an independent unix-word-rubout? >>> >>> Improves attribution, and it's independently useful. >> >> As a standalone command? > > I mean, yeah, I have had it on my C-w for years. Probably some other > people have implementations too. In that case, it would be difficult to use it directly in this implementation, as kill-region needs a command that just moves the point. I guess it would be possible to hack something together with atomic change groups, but the cleanest strategy would probably be to have a unix-word-forward command that goes in both directions, and use that both in a standalone unix-word-rubout and this patch. But we can do that after merging this patch -- assuming there are no more blocking issues with the latest version: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-kill-region-kill-the-last-word-when-there-is-n.patch >From fa7b5158fb1507db32a7b537137418afa024cfad Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 3 Sep 2024 18:29:56 +0200 Subject: [PATCH] Allow 'kill-region' kill the last word when there is no region * etc/NEWS: Document the new user option. * lisp/simple.el (kill-region-dwim): Add new option. (kill-region): Respect 'kill-region-dwim'. (Bug#69097) --- etc/NEWS | 8 +++++++- lisp/simple.el | 49 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1e66f084117..60efbfb43d8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,12 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. +--- +** New user option 'kill-word-if-no-region'. +This option will modify the fall-back behaviour of 'kill-region' if no +region is active, and will kill the last word instead of raising an +error. + * Changes in Specialized Modes and Packages in Emacs 31.1 @@ -268,7 +274,7 @@ any. ** Diff --- -*** New command 'diff-kill-ring-save'. +*** New command 'diff-kill-dwim'. This command copies to the 'kill-ring' a region of text modified according to diffs in the current buffer, but without applying the diffs to the original text. If the selected range extends a hunk, the diff --git a/lisp/simple.el b/lisp/simple.el index eedc5768fe2..efa338f0b0d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5817,6 +5817,18 @@ kill-read-only-ok :type 'boolean :group 'killing) +(defcustom kill-region-dwim nil + "Behaviour when `kill-region' is invoked without an active region. +If set to nil (default), the behaviour of `kill-region' stays the same. +If set to `emacs-word', then kill the last word as defined by the +current major mode. If set to `unix-word', then kill the last word in +the style of a shell like Bash, disregarding the major mode." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil)) + :group 'killing + :version "31.1") + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5843,21 +5855,44 @@ kill-region (To delete text, use `delete-region'.) Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current + `region', the function ignores BEG and END, and kills the current region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." + this command always kills the current region. It is possible to + override this behaviour by customising the user option + `kill-region-dwim'." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) + (cond + ((and kill-region-dwim (not (use-region-p))) + (list beg end kill-region-dwim)) + ((not (or beg end)) (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + ((list beg end 'region)))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((eq region 'emacs-word) + (let ((end (point))) + (save-excursion + (forward-word -1) + (filter-buffer-substring (point) end 'delete)))) + ((eq region 'unix-word) + (let ((end (point))) + (save-excursion + (skip-chars-backward "[:space:]") + (skip-chars-backward "^[:space:]") + (filter-buffer-substring + (if (get-char-property (point) 'read-only) + (next-single-char-property-change + (point) 'read-only nil end) + (point)) + end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) -- 2.45.2 --=-=-= Content-Type: text/plain -- Philip Kaludercic on siskin --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 07:31:49 2024 Received: (at 69097) by debbugs.gnu.org; 6 Sep 2024 11:31:49 +0000 Received: from localhost ([127.0.0.1]:52251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXBs-0000aj-H7 for submit@debbugs.gnu.org; Fri, 06 Sep 2024 07:31:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXBq-0000aN-Jg for 69097@debbugs.gnu.org; Fri, 06 Sep 2024 07:31:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smXBk-0001c3-Bl; Fri, 06 Sep 2024 07:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FA5uyNroJj7eDB2+jwvVTQmeTH3ve11r6RxOZ/JFfM8=; b=X2qaInMi1jnt r8ypHwqEQdKo+TSyERApJiXczaKJHAPvmIEhuF+yA1oZ/HIAUh5kTIb5vtTq158J786nAFpd05tcf QErlmjAIw4657xnu4C4FmHk/ykhaGjNxUTdxzNcoHcMrW4CL/j7fQQDqtcdBDJHn4nVLBP78/kxd/ +nTKMkVtyErac7tWsWfV32scToeA9Z0iA7muUncfAcOeosInME+9wAE/2447Yi4079SbsjVmGQp84 EgfORMh4G53MWQ8ecjz/yAHG8czJVzPvU2idcBQR+9bMMcnIMxWijAorv9GiFAlqsKuu10OtTqRqh Cr4KLXRNEWcuRG/Nz4Jeng==; Date: Fri, 06 Sep 2024 14:30:54 +0300 Message-Id: <86frqd10k1.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <877cbpvzkm.fsf@zephyr.silentflame.com> (message from Sean Whitton on Fri, 06 Sep 2024 11:36:25 +0100) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87cyq26bt8.fsf@posteo.net> <864jbeixkt.fsf@gnu.org> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: Eli Zaretskii , stefankangas@gmail.com, > acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Fri, 06 Sep 2024 11:36:25 +0100 > > I think you're right, but I would like to commit my function first, so > that I get attribution (it did take me some time to figure out what was > useful in this area), and because I think it should be rewritten in > terms of fields. > > Please take a look at the attached. unix-word-rubout to follow. Thanks, but I see no reason to document this command in the manual, certainly not in the ELisp reference (it's a command, not a function). IMO it's obscure enough to be documented only in NEWS. > +(defun forward-unix-word (&optional arg delim) > + "Move forward to the end of the next whitespace-delimited word. > +With argument ARG, do this that many times; the default is once. > +With negative ARG, go backwards to the beginning of whitespace-delimited > +words. > +DELIM is a string specifying what characters are considered whitespace, > +as might be passed to `skip-chars-forward'. > +The default is \"[:space:]\\n\". Do not prefix a `^' character. Should this be "[:space:]\\n\\r" instead? if not, why not? Also note that [:space:] depends on mode-specific syntax table, so I question the wisdom of using it in a command that's supposed to be mode-agnostic. > +This command is like `forward-word' except that words are always > +delimited by whitespace, regardless of the buffer's syntax table. > +Like `forward-word', this command respects fields. > + > +This emulates how C-w at the Unix terminal or shell identifies words. > +See the `unix-word-rubout' command in Info node `(readline)Commands For > +Killing'." This should try to be more explicit about what "word" means for this command. Since it's so different from any notion of "word" in Emacs, I would even seriously consider not to use that word, or maybe quote it (in addition to explaining what it means). Also, since this is a command, its doc string should clearly separate what happens in interactive invocation from what happens when called from Lisp. DELIM belongs to the latter. (Is it even useful to provide that option for Lisp-only calls? what's the use case for that?) And finally, I wonder why we need this command? AFAIU, the original intent was to implement something similar to unix-word-rubout, not a new movement command. If the plan has changed, I think we need to discuss the need once again. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 07:38:08 2024 Received: (at 69097) by debbugs.gnu.org; 6 Sep 2024 11:38:08 +0000 Received: from localhost ([127.0.0.1]:52325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXI0-0000xg-Bk for submit@debbugs.gnu.org; Fri, 06 Sep 2024 07:38:08 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:49268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXHv-0000ws-Hz for 69097@debbugs.gnu.org; Fri, 06 Sep 2024 07:38:07 -0400 DKIM-Signature: a=rsa-sha256; b=kmlUrPttb5spv8mu2XepiEEEHK/5Jf9em5+3MwQc/nsgr0+9fowoAnxy2J3daIGcd6bieVLiKot2gaLHFJTWHBTvLAl3t1+SBfV1YJWNo4RkIfjqemoTt+bzut2Mn/RKy4QfAprR1WPc6DUrEFkLRxYtib1P9xD08bSbtrrZSaO+9LTc0SV/fzECvpNSsKT/vC55dJSAKJVj2V1apa2VPU3U4+IRaeSN1iVHcUfPoIkN0A44mE8auHJW/TAx1xelicLS4oj9NyCjmfkqnqS5xWQ6LJQzwr8trTf0lkkCB225EqRHxQjJV8h1hU1Fop6z443eH/Ck7AHUa02H/80lVA==; s=purelymail1; d=spwhitton.name; v=1; bh=ZCSRTA3UZdNRqwN5UIivj03uwyn38i6GX+H64wVq90c=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=FlMOrjl9eldAkYHO7+Icstq2DMsY3hKG0FfGptiYQz8ClMfjaiZ/7fzVlrFDxkNyDRAFPABxs6sBJo+NX4Ckn5810bx6aT3I/8y3/79nuAjeSwqIOaUBH6Aws//8sDeltfmln6K5YM83velEeKWJ0ntGyGSRh2I5LeOLjlv0Mhe+Q4jaondPjKA0a/Zx2eyT5aSzppGg6xgIyKsHttBTTugnhxQBZVXsi0fM8R8O/qbC56xCtwEf8ZdnhdE78V7pYGpKk+kQoMS88OU/NFBpcjzdz0lz8fkfzXzzDZjFHKLXMv1LtHNAvJnADN6f0A5h2clobrTPRRE8CnHcDUz4kg==; s=purelymail1; d=purelymail.com; v=1; bh=ZCSRTA3UZdNRqwN5UIivj03uwyn38i6GX+H64wVq90c=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1203110684; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Sep 2024 11:06:22 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 5AEC09417C1; Fri, 6 Sep 2024 12:06:21 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <877cbpvzkm.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Fri, 06 Sep 2024 11:36:25 +0100") References: <871q9g8z8k.fsf@posteo.net> <864jbeixkt.fsf@gnu.org> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> Date: Fri, 06 Sep 2024 12:06:21 +0100 Message-ID: <87zfolujma.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Fri 06 Sep 2024 at 11:36am +01, Sean Whitton wrote: > diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi > index 37cfe264157..b576df82382 100644 > --- a/doc/lispref/positions.texi > +++ b/doc/lispref/positions.texi > @@ -275,6 +275,19 @@ Word Motion > syntax tables. > @end defun > > +@deffn Command forward-unix-word &optional arg delim > +This function is like @code{forward-word}, except that words are always > +delimited by whitespace, regardless of the buffer's syntax table. This > +emulates how @kbd{C-w} at the Unix terminal or shell identifies words. > +See the @code{unix-word-rubout} command in @xref{(readline)Commands For > +Killing}. > + > +Lisp programs can pass the @var{delim} argument to specify the notion of > +whitespace. This argument is a string listing the characters considered > +whitespace, as might be passed to @code{skip-chars-forward}. The > +default is @code{[:space:]\n}. Do not prefix a `^' character. > +@end deffn The `^' should use @code{}. > diff --git a/lisp/simple.el b/lisp/simple.el > index 2453a129d0a..f34eef9ac25 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -8892,6 +8892,36 @@ current-word > ;; If we found something nonempty, return it as a string. > (unless (= start end) > (buffer-substring-no-properties start end))))) > + > +(defun forward-unix-word (&optional arg delim) > + "Move forward to the end of the next whitespace-delimited word. ARG is not optional, only DELIM, in fact. I will fix this. I thought I should also explain this DELIM thing. In addition to Philip's usage and unix-word-rubout, I would like to add unix-filename-rubout, which I think is generally useful -- it's also in (info "(readline)Commands For Killing"). DELIM is needed for that. It also makes the function more generally useful to Lisp programmers -- you might want to drop \n, for example. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 07:38:27 2024 Received: (at 69097) by debbugs.gnu.org; 6 Sep 2024 11:38:27 +0000 Received: from localhost ([127.0.0.1]:52341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXII-0000ym-5Y for submit@debbugs.gnu.org; Fri, 06 Sep 2024 07:38:26 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:60874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smXIG-0000yM-AY for 69097@debbugs.gnu.org; Fri, 06 Sep 2024 07:38:25 -0400 DKIM-Signature: a=rsa-sha256; b=dJ1ECiTBiAI2Hd4xuXbADB55zx3WBP9PyLBZkIgPL6WZvlbhBuTxtd2rTRhWsvotjVI+sSuq1toXkYo23zHE97XxzuLj0BClbA2pXTvgvUEx9LGIjnHaYsstn4ROL/N7vlvqaxLp/k7iopaWIk9u3vLGowpVdxu6EnL/PXrbWJuwg9iw5018kPlz8Vs/qTxJ0MDD0X7VAIzyO2HYUInRDlQhM/MF7MY/JglWpdbRfG1v4rGrWbZJ2kV5KuvOlF0bWEP96UCFBbhOGX2pAmDf5SRmubtZJoVw0fIg5uAxB6zuODSyXpyEzq3i73sLDbLp8EPHsbYQ4hjz/Ba7CEwbpQ==; s=purelymail1; d=spwhitton.name; v=1; bh=My1dxu8enmZfLgOhFe11RnWyvpXgtlvFWjnDGatvxwA=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=AiPq5b7Pu9ThpDgNT+jS//YN+zxFE6IVqjtvGp6Weyy3AMxcgt+Enl/Vt6YBcck1U80lCapa+55nQ0jZg/+rttLcUuHtDnfZnwzF6UV61bRHUY6mikIMe2qve9qjBveIIt9eKncVlAiInWNudv1MXekT5ilWWM3VLyEWFY35obysiwlOMFuYhrHbfucIdn9q1Y97Lusa4ygwzQyQTnZdnVDALY1f29gCXQ/ggdsX9oTDuf7MXBQC58WaIhTT296BSuBhwQfjaw4qHQaA5TLTsPZU8qlJ6xukbX4D1Uql59xwd0IepC4NRv0JrDjma1Bgvml5WAUKngcYXanw6OKuMg==; s=purelymail1; d=purelymail.com; v=1; bh=My1dxu8enmZfLgOhFe11RnWyvpXgtlvFWjnDGatvxwA=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 871606815; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Sep 2024 10:36:26 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id A487A9417C1; Fri, 6 Sep 2024 11:36:25 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <871q1yw4fz.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 05 Sep 2024 14:38:56 +0000") References: <871q9g8z8k.fsf@posteo.net> <87cyq26bt8.fsf@posteo.net> <864jbeixkt.fsf@gnu.org> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> Date: Fri, 06 Sep 2024 11:36:25 +0100 Message-ID: <877cbpvzkm.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, On Thu 05 Sep 2024 at 02:38pm GMT, Philip Kaludercic wrote: > In that case, it would be difficult to use it directly in this > implementation, as kill-region needs a command that just moves the > point. I guess it would be possible to hack something together with > atomic change groups, but the cleanest strategy would probably be to > have a unix-word-forward command that goes in both directions, and use > that both in a standalone unix-word-rubout and this patch. But we can > do that after merging this patch -- assuming there are no more blocking > issues with the latest version: I think you're right, but I would like to commit my function first, so that I get attribution (it did take me some time to figure out what was useful in this area), and because I think it should be rewritten in terms of fields. Please take a look at the attached. unix-word-rubout to follow. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-command-forward-unix-word.patch >From 4cb701150976cdb91658a1c82edd6e8270fd26c8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Sep 2024 11:35:46 +0100 Subject: [PATCH] New command forward-unix-word * lisp/simple.el (forward-unix-word): New command. * doc/lispref/positions.texi (Word Motion): * etc/NEWS: Document it. --- doc/lispref/positions.texi | 13 +++++++++++++ etc/NEWS | 5 +++++ lisp/simple.el | 30 ++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 37cfe264157..b576df82382 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -275,6 +275,19 @@ Word Motion syntax tables. @end defun +@deffn Command forward-unix-word &optional arg delim +This function is like @code{forward-word}, except that words are always +delimited by whitespace, regardless of the buffer's syntax table. This +emulates how @kbd{C-w} at the Unix terminal or shell identifies words. +See the @code{unix-word-rubout} command in @xref{(readline)Commands For +Killing}. + +Lisp programs can pass the @var{delim} argument to specify the notion of +whitespace. This argument is a string listing the characters considered +whitespace, as might be passed to @code{skip-chars-forward}. The +default is @code{[:space:]\n}. Do not prefix a `^' character. +@end deffn + @node Buffer End Motion @subsection Motion to an End of the Buffer @cindex move to beginning or end of buffer diff --git a/etc/NEWS b/etc/NEWS index f3e719a34d3..8037fcfd1af 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,11 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. ++++ +** New command 'forward-unix-word'. +This command is like 'forward-word', except it always considers words to +be delimited by whitespace, regardless of the buffer's syntax table. +It thus emulates how C-w at the Unix terminal or shell identifies words. * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index 2453a129d0a..f34eef9ac25 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8892,6 +8892,36 @@ current-word ;; If we found something nonempty, return it as a string. (unless (= start end) (buffer-substring-no-properties start end))))) + +(defun forward-unix-word (&optional arg delim) + "Move forward to the end of the next whitespace-delimited word. +With argument ARG, do this that many times; the default is once. +With negative ARG, go backwards to the beginning of whitespace-delimited +words. +DELIM is a string specifying what characters are considered whitespace, +as might be passed to `skip-chars-forward'. +The default is \"[:space:]\\n\". Do not prefix a `^' character. + +This command is like `forward-word' except that words are always +delimited by whitespace, regardless of the buffer's syntax table. +Like `forward-word', this command respects fields. + +This emulates how C-w at the Unix terminal or shell identifies words. +See the `unix-word-rubout' command in Info node `(readline)Commands For +Killing'." + (interactive "^p") + (unless (zerop arg) + ;; We do skip over \n by default because `backward-word' does. + (let* ((delim (or delim "[:space:]\n")) + (ndelim (format "^%s" delim)) + (start (point)) + (fun (if (> arg 0) + #'skip-chars-forward + #'skip-chars-backward))) + (dotimes (_ (abs arg)) + (funcall fun delim) + (funcall fun ndelim)) + (constrain-to-field nil start)))) (defcustom fill-prefix nil "String for filling to insert at front of new line, or nil for none." -- 2.39.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 09:55:13 2024 Received: (at 69097) by debbugs.gnu.org; 6 Sep 2024 13:55:14 +0000 Received: from localhost ([127.0.0.1]:52552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZQf-0000bP-Bt for submit@debbugs.gnu.org; Fri, 06 Sep 2024 09:55:13 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:57596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZQZ-0000SR-Cd for 69097@debbugs.gnu.org; Fri, 06 Sep 2024 09:55:11 -0400 DKIM-Signature: a=rsa-sha256; b=RS/WLF7C4KAzomaMIFLFTeTdEp41BcnyUhzfprWT70yvuN9rRNAiwVq+Wfrfb0YudcFcgaZmrGccjVvaL7LRejxon7mylwRDjLkEIBGscQSXcGQisL+qiJvnZiYVW5zIzN8o/hCND2ydjAQnIL2y7DIfyGvU3E3tcXZWQfAG+fFLOp80nPbar4Re4cIkyGe6BkdxIHbBU9Tgo2jVEDkkwKA+VvK3/r/sJyAOs+kmgo1mezwaPu6XwrKVtIi0YHXlNLLyAf8Sq/ZYpcHRsx0D95+4PuQQkwU6YHoF3vQ0bFT5Aa9f6gWXdbZEtI3Sliq/OWha62cowWqAwHtSy3NEew==; s=purelymail1; d=spwhitton.name; v=1; bh=XsRNMUAbZUmdYcQ4A5M0cEXDOYM2yqURolKMyktfL8o=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=HBI3p47WZLxeW9IfjkqQCsNPzKrwfkmHgzp2wD/KYK5o9s/QMZmBQJt0YdtAgvf9sTyLKXpGxnmv789mWeRH08AWkU6Zj/HL8pN1bxmijN1+WAAPY/u96Ql2d2h7zYcM8v0q2l35YOLytqIdcIYwiRx0ffRPZTvrxiuCoXHZxtBD7ZUhgenxR3DsnafmQqEQ+SX8lI6xR6UIYL2yx/hc7bNonJXDtGIM5slYdkIU+uxTAQxDLCi5cehYjh/JC4JLgCs0E2SWWBS1d6YaufNMbf6/wjPAdAL1mW/nb6USyJvzhs1GNDCrk3NQBRXoSkALwcanQK8sXCrt954INZe4Gg==; s=purelymail1; d=purelymail.com; v=1; bh=XsRNMUAbZUmdYcQ4A5M0cEXDOYM2yqURolKMyktfL8o=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1129177749; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Sep 2024 13:54:59 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 5FE74949A14; Fri, 6 Sep 2024 14:54:58 +0100 (BST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86frqd10k1.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 14:30:54 +0300") References: <871q9g8z8k.fsf@posteo.net> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> Date: Fri, 06 Sep 2024 14:54:58 +0100 Message-ID: <87r09wvqdp.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, On Fri 06 Sep 2024 at 02:30pm +03, Eli Zaretskii wrote: > Thanks, but I see no reason to document this command in the manual, > certainly not in the ELisp reference (it's a command, not a function). > IMO it's obscure enough to be documented only in NEWS. That's quite fine with me. > Should this be "[:space:]\\n\\r" instead? if not, why not? > > Also note that [:space:] depends on mode-specific syntax table, so I > question the wisdom of using it in a command that's supposed to be > mode-agnostic. Both excellent points, thank you. I looked at the POSIX standard and came up with a new default value. >> +This command is like `forward-word' except that words are always >> +delimited by whitespace, regardless of the buffer's syntax table. >> +Like `forward-word', this command respects fields. >> + >> +This emulates how C-w at the Unix terminal or shell identifies words. >> +See the `unix-word-rubout' command in Info node `(readline)Commands For >> +Killing'." > > This should try to be more explicit about what "word" means for this > command. Since it's so different from any notion of "word" in Emacs, > I would even seriously consider not to use that word, or maybe quote > it (in addition to explaining what it means). This is very helpful. You're right. In the attached, I've tried using "unix-word". Let me know what you think of that. > Also, since this is a command, its doc string should clearly separate > what happens in interactive invocation from what happens when called > from Lisp. DELIM belongs to the latter. (Is it even useful to > provide that option for Lisp-only calls? what's the use case for > that?) > > And finally, I wonder why we need this command? AFAIU, the original > intent was to implement something similar to unix-word-rubout, not a > new movement command. If the plan has changed, I think we need to > discuss the need once again. I think it was unhelpful of me to send this in without callers. I'm sorry about that. The reason for adding this is that it factors out what is in common between what Philip is doing, and unix-word-rubout. So in the attached revised patch, I've included unix-word-rubout. I've also included a second readline command which I have bound in my own init. It demonstrates why there is a need for DELIM. By the way, forward-unix-word could also be a plain function. I made it a command because, well, why not. Let me know if you think it should be switched back to a function. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-commands-for-moving-and-killing-unix-words.patch >From c047e640399bb923728ed9967e8545d53b22ea5c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Sep 2024 11:35:46 +0100 Subject: [PATCH] New commands for moving and killing unix-words * lisp/simple.el (forward-unix-word, unix-word-rubout) (unix-filename-rubout): New commands. * etc/NEWS: Document them. --- etc/NEWS | 7 +++++++ lisp/simple.el | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index f3e719a34d3..54cf0a3df52 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,13 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. +--- +** New commands for moving and killing unix-words. +Unix-words are words separated by whitespace regardless of the buffer's +syntax table. In a Unix terminal or shell, C-w kills by unix-word. +The new commands 'forward-unix-word', 'unix-word-rubout' and +'unix-filename-rubout' allow you to bind keys to operate more similarly +to the terminal. * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index 2453a129d0a..0322ac0cd8c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8892,6 +8892,63 @@ current-word ;; If we found something nonempty, return it as a string. (unless (= start end) (buffer-substring-no-properties start end))))) + +(defun forward-unix-word (arg &optional delim) + "Move forward ARG unix-words. +A unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means go backwards to the beginning of unix-words. + +Unix-words differ from Emacs words in that they are always delimited by +whitespace, regardless of the buffer's syntax table. This command +emulates how C-w at the Unix terminal or shell identifies words. + +When called from Lisp, DELIM specifies what characters are considered +whitespace. It is a string as might be passed to `skip-chars-forward'. +The default is \" \\f\\n\\r\\t\\v\". Do not prefix a `^' character." + (interactive "^p") + (unless (zerop arg) + ;; We do skip over newlines by default because `backward-word' does. + (let* ((delim (or delim " \f\n\r\t\v")) + (ndelim (format "^%s" delim)) + (start (point)) + (fun (if (> arg 0) + #'skip-chars-forward + #'skip-chars-backward))) + (dotimes (_ (abs arg)) + (funcall fun delim) + (funcall fun ndelim)) + (constrain-to-field nil start)))) + +(defun unix-word-rubout (arg) + "Kill ARG unix-words backwards. +A unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means to kill forwards. + +Unix-words differ from Emacs words in that they are always delimited by +whitespace, regardless of the buffer's syntax table. Thus, this command +emulates C-w at the Unix terminal or shell identifies words. +See also this command's nakesake in Info node +`(readline)Commands For Killing'." + (interactive "^p") + (let ((start (point))) + (forward-unix-word (- arg)) + (kill-region start (point)))) + +(defun unix-filename-rubout (arg) + "Kill ARG unix-words backwards, also treating `/' as whitespace. +A unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means to kill forwards. + +This is like `unix-word-rubout' (which see), but `/' is also considered +whitespace. See this command's namesake in Info node +`(readline)Commands For Killing'." + (interactive "^p") + (let ((start (point))) + (forward-unix-word (- arg) "/ \f\n\r\t\v") + (kill-region start (point)))) (defcustom fill-prefix nil "String for filling to insert at front of new line, or nil for none." -- 2.39.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 12:32:46 2024 Received: (at 69097) by debbugs.gnu.org; 6 Sep 2024 16:32:46 +0000 Received: from localhost ([127.0.0.1]:54083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbt7-0001YV-Ox for submit@debbugs.gnu.org; Fri, 06 Sep 2024 12:32:46 -0400 Received: from mout02.posteo.de ([185.67.36.66]:37631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbt2-0001Xu-Fi for 69097@debbugs.gnu.org; Fri, 06 Sep 2024 12:32:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D2D70240101 for <69097@debbugs.gnu.org>; Fri, 6 Sep 2024 18:32:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725640354; bh=Dq9WCtgjKk2nf+KdVuPDXv2Skc9XTpz1B7liv2WzY6Q=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=FKy1nTBURL5XDiva8mOfeprqerrGvumKQiG9kNPOyKgUfTyNVthnKFunTT+Z/fDBs 3hPvhVq8mFqcf7H55Q+b3VDczixHCnqQH5Uun8itrUOA+ErMvkJM+DV2Dx1bpN3DDF 8HUBTqD3BiU9pmsZvkFEJp1c226grBbNqUL1HYYZ+0mS2YTPPFS6fyyiMn6hZZfwHO CRTYKpKj+9DMl5C8ARPMS/IDdvsRdekG0WMnLIhaJ0GEOXxJqYBGOhPyIiLjUlH44/ v7z6PTcJUBwsVVEmPQ+Kk+eBhf/jBvd2qzgxB9gT5ymizje31d8OCopvyL7VUy9hvj yz2w4LC126PBA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X0hbN5Ppvz9rxK; Fri, 6 Sep 2024 18:32:32 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87r09wvqdp.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Fri, 06 Sep 2024 14:54:58 +0100") References: <871q9g8z8k.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Fri, 06 Sep 2024 16:32:31 +0000 Message-ID: <87jzfozqsg.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > Hello, > > On Fri 06 Sep 2024 at 02:30pm +03, Eli Zaretskii wrote: > >> Thanks, but I see no reason to document this command in the manual, >> certainly not in the ELisp reference (it's a command, not a function). >> IMO it's obscure enough to be documented only in NEWS. > > That's quite fine with me. > >> Should this be "[:space:]\\n\\r" instead? if not, why not? >> >> Also note that [:space:] depends on mode-specific syntax table, so I >> question the wisdom of using it in a command that's supposed to be >> mode-agnostic. > > Both excellent points, thank you. I looked at the POSIX standard and > came up with a new default value. > >>> +This command is like `forward-word' except that words are always >>> +delimited by whitespace, regardless of the buffer's syntax table. >>> +Like `forward-word', this command respects fields. >>> + >>> +This emulates how C-w at the Unix terminal or shell identifies words. >>> +See the `unix-word-rubout' command in Info node `(readline)Commands For >>> +Killing'." >> >> This should try to be more explicit about what "word" means for this >> command. Since it's so different from any notion of "word" in Emacs, >> I would even seriously consider not to use that word, or maybe quote >> it (in addition to explaining what it means). > > This is very helpful. You're right. In the attached, I've tried using > "unix-word". Let me know what you think of that. > >> Also, since this is a command, its doc string should clearly separate >> what happens in interactive invocation from what happens when called >> from Lisp. DELIM belongs to the latter. (Is it even useful to >> provide that option for Lisp-only calls? what's the use case for >> that?) >> >> And finally, I wonder why we need this command? AFAIU, the original >> intent was to implement something similar to unix-word-rubout, not a >> new movement command. If the plan has changed, I think we need to >> discuss the need once again. > > I think it was unhelpful of me to send this in without callers. > I'm sorry about that. > > The reason for adding this is that it factors out what is in common > between what Philip is doing, and unix-word-rubout. > So in the attached revised patch, I've included unix-word-rubout. Right, this is the command that we agreed on being necessary to appease both people who want C-w to kill the region when no transient region is active or to kill a word. > I've also included a second readline command which I have bound in my > own init. It demonstrates why there is a need for DELIM. > > By the way, forward-unix-word could also be a plain function. > I made it a command because, well, why not. Let me know if you think it > should be switched back to a function. > > -- > Sean Whitton > > From c047e640399bb923728ed9967e8545d53b22ea5c Mon Sep 17 00:00:00 2001 > From: Sean Whitton > Date: Fri, 6 Sep 2024 11:35:46 +0100 > Subject: [PATCH] New commands for moving and killing unix-words > > * lisp/simple.el (forward-unix-word, unix-word-rubout) > (unix-filename-rubout): New commands. > * etc/NEWS: Document them. > --- > etc/NEWS | 7 +++++++ > lisp/simple.el | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 64 insertions(+) > > diff --git a/etc/NEWS b/etc/NEWS > index f3e719a34d3..54cf0a3df52 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -123,6 +123,13 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch > fonts, the wrapped text will now be lined up correctly so that it's > exactly below the text after the prefix on the first line. > > +--- > +** New commands for moving and killing unix-words. > +Unix-words are words separated by whitespace regardless of the buffer's > +syntax table. In a Unix terminal or shell, C-w kills by unix-word. > +The new commands 'forward-unix-word', 'unix-word-rubout' and > +'unix-filename-rubout' allow you to bind keys to operate more similarly > +to the terminal. > > * Changes in Specialized Modes and Packages in Emacs 31.1 > > diff --git a/lisp/simple.el b/lisp/simple.el > index 2453a129d0a..0322ac0cd8c 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -8892,6 +8892,63 @@ current-word > ;; If we found something nonempty, return it as a string. > (unless (= start end) > (buffer-substring-no-properties start end))))) > + > +(defun forward-unix-word (arg &optional delim) > + "Move forward ARG unix-words. > +A unix-word is whitespace-delimited. > +Interactively, ARG is the numeric prefix argument, defaulting to 1. > +A negative ARG means go backwards to the beginning of unix-words. > + > +Unix-words differ from Emacs words in that they are always delimited by > +whitespace, regardless of the buffer's syntax table. This command > +emulates how C-w at the Unix terminal or shell identifies words. Should you mention the ^W notation here as well? > + > +When called from Lisp, DELIM specifies what characters are considered > +whitespace. It is a string as might be passed to `skip-chars-forward'. > +The default is \" \\f\\n\\r\\t\\v\". Do not prefix a `^' character." I think it would be worth checking for a ^ and then throwing a user-error. > + (interactive "^p") > + (unless (zerop arg) > + ;; We do skip over newlines by default because `backward-word' does. > + (let* ((delim (or delim " \f\n\r\t\v")) ^ I'd use "\s" here (and below). > + (ndelim (format "^%s" delim)) > + (start (point)) > + (fun (if (> arg 0) > + #'skip-chars-forward > + #'skip-chars-backward))) > + (dotimes (_ (abs arg)) > + (funcall fun delim) > + (funcall fun ndelim)) > + (constrain-to-field nil start)))) > + > +(defun unix-word-rubout (arg) > + "Kill ARG unix-words backwards. > +A unix-word is whitespace-delimited. > +Interactively, ARG is the numeric prefix argument, defaulting to 1. > +A negative ARG means to kill forwards. > + > +Unix-words differ from Emacs words in that they are always delimited by > +whitespace, regardless of the buffer's syntax table. Thus, this command > +emulates C-w at the Unix terminal or shell identifies words. > +See also this command's nakesake in Info node > +`(readline)Commands For Killing'." > + (interactive "^p") > + (let ((start (point))) > + (forward-unix-word (- arg)) > + (kill-region start (point)))) Won't there be an error here if the command is invoked with a negative argument? > + > +(defun unix-filename-rubout (arg) > + "Kill ARG unix-words backwards, also treating `/' as whitespace. > +A unix-word is whitespace-delimited. > +Interactively, ARG is the numeric prefix argument, defaulting to 1. > +A negative ARG means to kill forwards. > + > +This is like `unix-word-rubout' (which see), but `/' is also considered > +whitespace. See this command's namesake in Info node > +`(readline)Commands For Killing'." > + (interactive "^p") > + (let ((start (point))) > + (forward-unix-word (- arg) "/ \f\n\r\t\v") > + (kill-region start (point)))) > > (defcustom fill-prefix nil > "String for filling to insert at front of new line, or nil for none." -- Philip Kaludercic on siskin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 05:53:05 2024 Received: (at 69097) by debbugs.gnu.org; 7 Sep 2024 09:53:05 +0000 Received: from localhost ([127.0.0.1]:54891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sms7t-0000S7-24 for submit@debbugs.gnu.org; Sat, 07 Sep 2024 05:53:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sms7k-0000PV-JP for 69097@debbugs.gnu.org; Sat, 07 Sep 2024 05:52:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sms7d-0005v7-4n; Sat, 07 Sep 2024 05:52:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VHCM3fDAb1RdDMU8+qSI2zz1WhQCNvaXftgjrSuGfy8=; b=hJ4qWqmA6PZE ruPfimcY5qlGt+gNTOkqu/gSXtQNXX2EHcf3g1pNsLsd2WO5HN6c3wUmp8O9DgJ0jEZdKzu5DBpLC yNLdof4TZ/V09pOGFdA/HgcoVCzJkFONd2sAzXXKg5JKWXo0PKYz3VE/FkFIBkFumZd/whFYEYrzy k7CTU50cDDHIPoCClrux7zTjXWy+ELidw9i9FhWgoEjtr6alMN4RKbrOu1YdApcoJabhLglLIiCJw R7regcC9JBRhBHn4uajMRXFa0CZs3Hkfc5gyEbPYTddP3rt4fcNDNZpBFjajjBIV8bUpzgIOMlo+I VcvscApoiX3hCjFsjnCQZg==; Date: Sat, 07 Sep 2024 12:52:39 +0300 Message-Id: <86frqbyemw.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87r09wvqdp.fsf@zephyr.silentflame.com> (message from Sean Whitton on Fri, 06 Sep 2024 14:54:58 +0100) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <874jbe65u0.fsf@posteo.net> <8634qwkbtc.fsf@mail.linkov.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: philipk@posteo.net, stefankangas@gmail.com, acorallo@gnu.org, > juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Fri, 06 Sep 2024 14:54:58 +0100 > > +(defun forward-unix-word (arg &optional delim) > + "Move forward ARG unix-words. > +A unix-word is whitespace-delimited. > +Interactively, ARG is the numeric prefix argument, defaulting to 1. > +A negative ARG means go backwards to the beginning of unix-words. I again ask whether we need this command. It is okay to have a function (perhaps even an internal one) to move by Unix-words, but what are the use cases for such a command? > +(defun unix-filename-rubout (arg) > + "Kill ARG unix-words backwards, also treating `/' as whitespace. > +A unix-word is whitespace-delimited. > +Interactively, ARG is the numeric prefix argument, defaulting to 1. > +A negative ARG means to kill forwards. > + > +This is like `unix-word-rubout' (which see), but `/' is also considered > +whitespace. I'd say '/' is treated as word delimiter. "Considered whitespace" sounds strange to me. Should we also treat a backslash as delimiter, for MS-Windows? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 06:10:41 2024 Received: (at 69097) by debbugs.gnu.org; 7 Sep 2024 10:10:41 +0000 Received: from localhost ([127.0.0.1]:54987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smsOu-0001ZK-LE for submit@debbugs.gnu.org; Sat, 07 Sep 2024 06:10:40 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smsOt-0001Z4-9q for 69097@debbugs.gnu.org; Sat, 07 Sep 2024 06:10:40 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6B050240103 for <69097@debbugs.gnu.org>; Sat, 7 Sep 2024 12:10:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725703832; bh=r7FCHKo0qcNTXMfZKzJ0Aytjw9aBW6H5Ckc6a1l3VLM=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=H0wm49z2c555rTCEpUgR6T0qu176ROWwdUdnxARV8G8s/7XlF2Xz5ym4o3PdjUKxk WGYs6YbCD/WPO67NbWbd2F1O7k4Cq83jdoaXvysbpKvLaFAyqGBLZ+qMrj3kEGVN7M h8Dxun60IQlYStXfSn5DkPF3C/c+B3hR/8rEB2FrFBjMQg5fPH60ASFezgSZhCjb+c ZZdoxHDkyskKkTcKBeUNZSFzOUYd2WAvrDJE4WpzWUDsgeak87SvtfCgOMmfocqjOY 2ydYpJwB712L4+LFzTyD40ooZRZhzRAom+1u0/69zjOYWgUp+PapErFl3GeV0YBOPs HyzRaX8+LrFrA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X18466d2Bz6tsg; Sat, 7 Sep 2024 12:10:30 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86frqbyemw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 12:52:39 +0300") References: <871q9g8z8k.fsf@posteo.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Sat, 07 Sep 2024 10:10:29 +0000 Message-ID: <87cylfzsdm.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, Sean Whitton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> From: Sean Whitton >> Cc: philipk@posteo.net, stefankangas@gmail.com, acorallo@gnu.org, >> juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org >> Date: Fri, 06 Sep 2024 14:54:58 +0100 >> >> +(defun forward-unix-word (arg &optional delim) >> + "Move forward ARG unix-words. >> +A unix-word is whitespace-delimited. >> +Interactively, ARG is the numeric prefix argument, defaulting to 1. >> +A negative ARG means go backwards to the beginning of unix-words. > > I again ask whether we need this command. It is okay to have a > function (perhaps even an internal one) to move by Unix-words, but > what are the use cases for such a command? I think it is conceivable that some users might prefer to have deterministic word movement that doesn't change depending on the major mode. But as mention earlier, this is functionality that might be worth relegating into a subword-mode-like mode, instead of defining new commands. >> +(defun unix-filename-rubout (arg) >> + "Kill ARG unix-words backwards, also treating `/' as whitespace. >> +A unix-word is whitespace-delimited. >> +Interactively, ARG is the numeric prefix argument, defaulting to 1. >> +A negative ARG means to kill forwards. >> + >> +This is like `unix-word-rubout' (which see), but `/' is also considered >> +whitespace. > > I'd say '/' is treated as word delimiter. "Considered whitespace" > sounds strange to me. > > Should we also treat a backslash as delimiter, for MS-Windows? -- Philip Kaludercic on siskin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 17:08:35 2024 Received: (at 69097) by debbugs.gnu.org; 7 Sep 2024 21:08:35 +0000 Received: from localhost ([127.0.0.1]:57712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sn2fb-0004V3-1V for submit@debbugs.gnu.org; Sat, 07 Sep 2024 17:08:35 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:49882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sn2fY-0004Um-1h for 69097@debbugs.gnu.org; Sat, 07 Sep 2024 17:08:33 -0400 DKIM-Signature: a=rsa-sha256; b=A92X87Z/PZCQIe0SGJ8skYCMdo6D6qkWn2dpCE22CQR5gHvZP5bU+PJranzq9lqpiEL30/E9yUTZtL90o5Mvgk4a6o2RDbb9RDVA2f7GWyJ+VHHox7ONcOuN2j0St0ErDPofksGCLtLwiyrcK7iwV677ifh/Dre4P6qeag9Tz9t+buC7lJ8xA+gkrUekl3gJO5RN5W7ILYGRaAkTYIvT5c61oiOxEQQVyraV1iB85VTkDVBa6r6yBhlevgHMjWgI0mbwF/OGMYv9b7edvWaEyDqTEGqDJ3GeoucjpOs56g0ONAsE9w7QM1NWm4jOaPtJqzUn1DJ2vPu9V2izU9V2sQ==; s=purelymail1; d=spwhitton.name; v=1; bh=EMCAqQvpCdNpPOUOrZjHijp+1L9q4pf5R8JOQWwFbYE=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=H5FR/SnYGdRFH0uJxEB+hBBM+twWA7h0bEMVZcsyRl7hZytiG3YZ2dNI+FwXMSN71ZM7qk0X0sFh0joh1p2W4P7TOTKMrr/IwaeGIaEwDn8EzK7rMmQ0CKDHvv0eqW7cE1uGMqO+uDlescgnZ6iE1Pqe2/aE/+CHN8uqIujsv4iB8ItcWgYRZ05TYxgA2+Y44fo4eN0pMqE84Uzj0+lDXW7uiVrYRchYAqGotFhbx4WbbrkdY1Uh1v6Er2ugxinuS4uM9Kp0a0rSJDCqxHB6+1UiVqcKrsqVVbBNxvZoW0rDJ7XdnvZdBOTJ17Yo6lDASCed0Q6UIG76AjVPzVPgiw==; s=purelymail1; d=purelymail.com; v=1; bh=EMCAqQvpCdNpPOUOrZjHijp+1L9q4pf5R8JOQWwFbYE=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 890174328; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 07 Sep 2024 21:08:17 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 155E9947C7D; Sat, 7 Sep 2024 22:08:17 +0100 (BST) From: Sean Whitton To: Eli Zaretskii , philipk@posteo.net Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86frqbyemw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 12:52:39 +0300") References: <871q9g8z8k.fsf@posteo.net> <86h6fceij2.fsf@gnu.org> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> Date: Sat, 07 Sep 2024 22:08:17 +0100 Message-ID: <871q1vuq7y.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org, acorallo@gnu.org, stefankangas@gmail.com, rms@gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, Thank you both for the feedback. Attached is an updated version. A few replies: On Fri 06 Sep 2024 at 04:32pm GMT, Philip Kaludercic wrote: > Won't there be an error here if the command is invoked with a negative > argument? Do you mean that you think there should be an error? I don't see any need for that. On Sat 07 Sep 2024 at 12:52pm +03, Eli Zaretskii wrote: > I again ask whether we need this command. It is okay to have a > function (perhaps even an internal one) to move by Unix-words, but > what are the use cases for such a command? That's fine. I've turned it back into a function. > Should we also treat a backslash as delimiter, for MS-Windows? Good idea. That's more useful. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v3-0001-New-commands-for-moving-and-killing-unix-words.patch >From 9163f6ab16816702f8bc6acb6f22734eb57acfc7 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Sep 2024 11:35:46 +0100 Subject: [PATCH v3] New commands for moving and killing unix-words * lisp/simple.el (forward-unix-word): New function. (unix-word-rubout, unix-filename-rubout): New commands. * etc/NEWS: Announce the new commands. --- etc/NEWS | 6 ++++++ lisp/simple.el | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index f3e719a34d3..104941425c2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,12 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. +--- +** New commands 'unix-word-rubout' and 'unix-filename-rubout'. +Unix-words are words separated by whitespace regardless of the buffer's +syntax table. In a Unix terminal or shell, C-w kills by Unix-word. +The new commands 'unix-word-rubout' and 'unix-filename-rubout' allow +you to bind keys to operate more similarly to the terminal. * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index 2453a129d0a..1b910b0ed22 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8892,6 +8892,63 @@ current-word ;; If we found something nonempty, return it as a string. (unless (= start end) (buffer-substring-no-properties start end))))) + +(defun forward-unix-word (n &optional delim) + "Move forward N Unix-words. +A Unix-word is whitespace-delimited. +A negative N means go backwards to the beginning of Unix-words. + +Unix-words differ from Emacs words in that they are always delimited by +whitespace, regardless of the buffer's syntax table. This function +emulates how C-w at the Unix terminal or shell identifies words. + +Optional argument DELIM specifies what characters are considered +whitespace. It is a string as might be passed to `skip-chars-forward'. +The default is \"\\s\\f\\n\\r\\t\\v\". Do not prefix a `^' character." + (when (and delim (string-prefix-p "^" delim)) + (error "DELIM argument must not begin with `^'")) + (unless (zerop n) + ;; We do skip over newlines by default because `backward-word' does. + (let* ((delim (or delim "\s\f\n\r\t\v")) + (ndelim (format "^%s" delim)) + (start (point)) + (fun (if (> n 0) + #'skip-chars-forward + #'skip-chars-backward))) + (dotimes (_ (abs n)) + (funcall fun delim) + (funcall fun ndelim)) + (constrain-to-field nil start)))) + +(defun unix-word-rubout (arg) + "Kill ARG Unix-words backwards. +A Unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means to kill forwards. + +Unix-words differ from Emacs words in that they are always delimited by +whitespace, regardless of the buffer's syntax table. +Thus, this command emulates C-w at the Unix terminal or shell. +See also this command's nakesake in Info node +`(readline)Commands For Killing'." + (interactive "^p") + (let ((start (point))) + (forward-unix-word (- arg)) + (kill-region start (point)))) + +(defun unix-filename-rubout (arg) + "Kill ARG Unix-words backwards, also treating `/' as delimiting words. +A Unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means to kill forwards. + +This is like `unix-word-rubout' (which see), but `/' is also treated as +a word delimiter. See this command's namesake in Info node +`(readline)Commands For Killing'." + (interactive "^p") + (let ((start (point))) + (forward-unix-word (- arg) "\\/\s\f\n\r\t\v") + (kill-region start (point)))) (defcustom fill-prefix nil "String for filling to insert at front of new line, or nil for none." -- 2.39.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 17:17:51 2024 Received: (at 69097) by debbugs.gnu.org; 7 Sep 2024 21:17:51 +0000 Received: from localhost ([127.0.0.1]:57718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sn2oZ-0004z5-9b for submit@debbugs.gnu.org; Sat, 07 Sep 2024 17:17:51 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:51266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sn2oX-0004yr-CN for 69097@debbugs.gnu.org; Sat, 07 Sep 2024 17:17:50 -0400 DKIM-Signature: a=rsa-sha256; b=kP1khnfHietKMj/deJutfl0CZrFHDysRbmXZxQYWTn7PwkAodlu9kTwhErUJ/PQIM8LbQ3WzxlsTtUs9d88zxybila1HF7/HlD1GRtftxS3a7Qsblzidg0tBXvOYygxTt4hLoJDau4qzprkVDLsnHa5D9KMCutTOMO9G3qfoxbplOUJUuLgB9J321CTJaLLcke2cJhc2XIkoVF+AvJmMbDgOcG4oD6ywIU62TokKzjHVt0EZZx5pqjQNKYUmCvecgAo6DPY8PTq4kQHuf6skb3paIIjzX85csuFSMqS2uQXtyO4vjNTlMRnctRDCqJQg9tlrvk/g1jmVq1IKRgJ4sw==; s=purelymail1; d=spwhitton.name; v=1; bh=urrdWD7DGU26KtOXhXuxjKbj+wcSPLks6kzN+/PdfSU=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=sGwKHtpetc3lWkKE/KFV98lDOOwsEJSw7Hhc2fCWCsvoWf0mVYVTwdhtjEMHftZ8dXrKD8kUFuPcNnuOfVBDjcT2yGokJAFCQO/JJ+YgsYAIbP4whJeTY37RGav9IlUn1ttkiPVhL3koEJLTnz4ifstCDEhsZUDp8cPzXt2S0CgsyFMv1Jlp7ifLUkeN+MqTzqMEtt79TdqHe4Rh7eASZq2xOSgThmX6Bt95hJt4TAkn4Uz/yH6Dta3RjTPoUVEYjmIbRQ8oWIlH/GkDysz2reFbulx+Ii3O6XPgyuaVa2mTEnanAi3NNpixEGa+7qjFgxW/D9MJVTrbiAD4rCZGSw==; s=purelymail1; d=purelymail.com; v=1; bh=urrdWD7DGU26KtOXhXuxjKbj+wcSPLks6kzN+/PdfSU=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -111460925; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 07 Sep 2024 21:17:39 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id E212B947C7D; Sat, 7 Sep 2024 22:17:38 +0100 (BST) From: Sean Whitton To: Eli Zaretskii , philipk@posteo.net Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <871q1vuq7y.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Sat, 07 Sep 2024 22:08:17 +0100") References: <871q9g8z8k.fsf@posteo.net> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> Date: Sat, 07 Sep 2024 22:17:38 +0100 Message-ID: <87wmjntb7x.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org, acorallo@gnu.org, stefankangas@gmail.com, rms@gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hello, On Sat 07 Sep 2024 at 10:08pm +01, Sean Whitton wrote: > Hello, > > Thank you both for the feedback. Attached is an updated version. I neglected to update the docstring for adding backslashes as delimiters in unix-filename-rubout. Fixed in the attached, along with a another few small fixes. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v4-0001-New-commands-unix-word-rubout-unix-filename-rubou.patch >From 059ca7388494f21d13c87f114965a2ec1fc1cc55 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Sep 2024 11:35:46 +0100 Subject: [PATCH v4] New commands unix-word-rubout, unix-filename-rubout * lisp/simple.el (forward-unix-word): New function. (unix-word-rubout, unix-filename-rubout): New commands. * etc/NEWS: Announce the new commands. --- etc/NEWS | 6 ++++++ lisp/simple.el | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index f3e719a34d3..104941425c2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,12 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. +--- +** New commands 'unix-word-rubout' and 'unix-filename-rubout'. +Unix-words are words separated by whitespace regardless of the buffer's +syntax table. In a Unix terminal or shell, C-w kills by Unix-word. +The new commands 'unix-word-rubout' and 'unix-filename-rubout' allow +you to bind keys to operate more similarly to the terminal. * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index 2453a129d0a..18cc15f6f5d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8892,6 +8892,63 @@ current-word ;; If we found something nonempty, return it as a string. (unless (= start end) (buffer-substring-no-properties start end))))) + +(defun forward-unix-word (n &optional delim) + "Move forward N Unix-words. +A Unix-word is whitespace-delimited. +A negative N means go backwards to the beginning of Unix-words. + +Unix-words differ from Emacs words in that they are always delimited by +whitespace, regardless of the buffer's syntax table. This function +emulates how C-w at the Unix terminal or shell identifies words. + +Optional argument DELIM specifies what characters are considered +whitespace. It is a string as might be passed to `skip-chars-forward'. +The default is \"\\s\\f\\n\\r\\t\\v\". Do not prefix a `^' character." + (when (string-prefix-p "^" delim) + (error "DELIM argument must not begin with `^'")) + (unless (zerop n) + ;; We do skip over newlines by default because `backward-word' does. + (let* ((delim (or delim "\s\f\n\r\t\v")) + (ndelim (format "^%s" delim)) + (start (point)) + (fun (if (> n 0) + #'skip-chars-forward + #'skip-chars-backward))) + (dotimes (_ (abs n)) + (funcall fun delim) + (funcall fun ndelim)) + (constrain-to-field nil start)))) + +(defun unix-word-rubout (arg) + "Kill ARG Unix-words backwards. +A Unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means to kill forwards. + +Unix-words differ from Emacs words in that they are always delimited by +whitespace, regardless of the buffer's syntax table. +Thus, this command emulates C-w at the Unix terminal or shell. +See also this command's nakesake in Info node +`(readline)Commands For Killing'." + (interactive "^p") + (let ((start (point))) + (forward-unix-word (- arg)) + (kill-region start (point)))) + +(defun unix-filename-rubout (arg) + "Kill ARG Unix-words backwards, also treating slashes as word delimiters. +A Unix-word is whitespace-delimited. +Interactively, ARG is the numeric prefix argument, defaulting to 1. +A negative ARG means to kill forwards. + +This is like `unix-word-rubout' (which see), but `/' and `\\' are also +treated as delimiting words. See this command's namesake in Info node +`(readline)Commands For Killing'." + (interactive "^p") + (let ((start (point))) + (forward-unix-word (- arg) "\\/\s\f\n\r\t\v") + (kill-region start (point)))) (defcustom fill-prefix nil "String for filling to insert at front of new line, or nil for none." -- 2.39.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 06:38:36 2024 Received: (at 69097) by debbugs.gnu.org; 8 Sep 2024 10:38:36 +0000 Received: from localhost ([127.0.0.1]:58005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snFJU-000484-0j for submit@debbugs.gnu.org; Sun, 08 Sep 2024 06:38:36 -0400 Received: from mout02.posteo.de ([185.67.36.66]:51521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snFJP-00047l-6Z for 69097@debbugs.gnu.org; Sun, 08 Sep 2024 06:38:34 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 77CDE240104 for <69097@debbugs.gnu.org>; Sun, 8 Sep 2024 12:38:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725791903; bh=bYLEUSsjePqjc3NhSYUkVau2UyDU2ehaFmRiQLGHXYo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=RHnz0B2/q8qQBg7v4GtHwxlGgWXdw/lTA+RUzSCxfLXd+e6l5IkJkFlTWRJTGx9HN SeZUNRYxfof4jVqKAovivQQkUutP7hxYOUfRaiOq5H3g1+wRqOMf3t/BZt75nhbIug gQeVyQ9+ZYyqcvLaLlHhQ7Boyc9UbavkKc1JFWikppGSE8HmP2yysJARn62cpohQjM q+jfLe+4UNhffE1e68w9v2Hy34mCR1ivcOUPe1NQqpGF9bqlL927NUs3p9y0fPZPVc xCBZF3Q0U5T6C84m95JHAh2YawEGEVh2nQia6Y53/HoGtDmSOz1P5kYalG9m+Lb6sj 8MtPjWsMh671Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X1mdn5ZNvz9rxB; Sun, 8 Sep 2024 12:38:21 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <871q1vuq7y.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Sat, 07 Sep 2024 22:08:17 +0100") References: <871q9g8z8k.fsf@posteo.net> <87edaeevmr.fsf@zephyr.silentflame.com> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> X-Hashcash: 1:20:240908:juri@linkov.net::LmEicJ7ThYh3+pEZ:R/6 X-Hashcash: 1:20:240908:eliz@gnu.org::U/JlqUDWl1ZII/jA:YUS X-Hashcash: 1:20:240908:rms@gnu.org::e9Tue+JNDilE67v/:onM X-Hashcash: 1:20:240908:69097@debbugs.gnu.org::r0ohsm/36RT2+aCo:1TXP X-Hashcash: 1:20:240908:acorallo@gnu.org::CDWmfiNriqsrzGws:5w1o X-Hashcash: 1:20:240908:spwhitton@spwhitton.name::LQquGnx6WFzs2OUz:32nj X-Hashcash: 1:20:240908:stefankangas@gmail.com::BbGYmfo9tpCMOCyw:9tFQ Date: Sun, 08 Sep 2024 10:38:21 +0000 Message-ID: <87wmjme8gy.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Sean Whitton writes: > Hello, > > Thank you both for the feedback. Attached is an updated version. > > A few replies: > > On Fri 06 Sep 2024 at 04:32pm GMT, Philip Kaludercic wrote: > >> Won't there be an error here if the command is invoked with a negative >> argument? > > Do you mean that you think there should be an error? > I don't see any need for that. I had mistakenly assumed that (kill-region start (point)) would throw an error if (> start (point)), and that it would be better to catch that case earlier. But I just checked, and kill-region does the right thing, so forget about it. -- Philip Kaludercic on icterid From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 09 13:54:31 2024 Received: (at 69097) by debbugs.gnu.org; 9 Sep 2024 17:54:32 +0000 Received: from localhost ([127.0.0.1]:34033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sniat-0003Ge-KX for submit@debbugs.gnu.org; Mon, 09 Sep 2024 13:54:31 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:37900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sniar-0003GP-0f for 69097@debbugs.gnu.org; Mon, 09 Sep 2024 13:54:30 -0400 DKIM-Signature: a=rsa-sha256; b=OtiQgXtV/pjH9AmhLbwQ17r4hSzH6Kra56BbAxMFCVgmkXvtpPjyp/ijy+wStPPdaxiGCBnnKQ7j6fEFRlulCsluJk/LEDkwxwh4kqwZy8zsmZMUo5dy6fNHh3xtOXJ9oIFegYPcJWT4JyOkz8/Tqf70+yuHMOLCX0vZ27e0RUfcb0oCItG67HFNvZ0nzKHhkz4JP2SAnuFamjVtQnXUm+i5+J0uuPKUxCLP41Mrg3baCj7tsWbbYDUuhfRL67czJi3McPv1rOIfWbBU/H4hJKuxO1LsKEV7oqKVcFNrEV44qaEPvfZmteCHx1MRZdFhN7feEu0dN2sOKEQCOEx+aw==; s=purelymail1; d=spwhitton.name; v=1; bh=tpqTN2OphjanOt+nV3mneOlPaixkUGOAeRljk1VxJgM=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Gbq0oaTfkuJpt8tUh6IvQYtSodBM7Wi5HtiejzSIvTwGfAW6wEgah5RyAQ2UgGVeiG+OQXBWQ3LVdfhnWGoQSFzZPi4wpeMLFqvi3wbu9KYD0VnfhXpixbrppEE/SRO27ZA5KHrLM1PXesV4RNruiE30qxatgygGyqx7rCwznSDHejR4RH44ZX41YX2nC7jXRGOMKV5jV0eNSGQk/nAKSBaR7aOuNFOAtydJReGg629yvz/uKSg+Q4Yc0Xv+pDBRIuKTobVHD74+/79+avw1mbTwl2wAbIaL8u1SEE6M79aIE3wqkkjdOdWI1MqTkZEgZjPziJ4ISdWmArHMCHLb9Q==; s=purelymail1; d=purelymail.com; v=1; bh=tpqTN2OphjanOt+nV3mneOlPaixkUGOAeRljk1VxJgM=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -2094980908; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 09 Sep 2024 17:54:17 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 94DBE949A28; Mon, 9 Sep 2024 18:54:16 +0100 (BST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87wmjntb7x.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Sat, 07 Sep 2024 22:17:38 +0100") References: <871q9g8z8k.fsf@posteo.net> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> Date: Mon, 09 Sep 2024 18:54:16 +0100 Message-ID: <87h6aosofr.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Eli, Any comments on v4? I'd like to commit to unblock Philip. Thanks! -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 09 15:04:20 2024 Received: (at 69097) by debbugs.gnu.org; 9 Sep 2024 19:04:20 +0000 Received: from localhost ([127.0.0.1]:34185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snjgR-00071N-Kv for submit@debbugs.gnu.org; Mon, 09 Sep 2024 15:04:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snjgP-000715-0V for 69097@debbugs.gnu.org; Mon, 09 Sep 2024 15:04:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snjgF-0007HX-4j; Mon, 09 Sep 2024 15:04:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=H/VF2q65yeSS9U3ZtZRGkDPKlKjAdL8FTbKt9AxhF9Y=; b=KGElTJtdm9hI Y+UvLgw9MwO2wqAFHIa/ChHak8QYJRts5qhc0avOzsbc6x5TkEfE4g+uUgHzfmh5904tjCqw5itYV Yj2CFC8BiwSuhQbssYBXA1u9MXYOiYFUPM7a2SLcaalf3Vp0rwk2Zj7o7+V2zcqKWSolyg9xFFPa4 2++vFfjAY/hBvqHiJfZxV5BUtv9cDXawtpOEOSZ+FSccETW7uh+RQeAlaPdagb5MFEX8DvAM28CvU FyMRyF/Hm8H4CMfM7zI7vYXdCwciwJ25BUg/I8HBM2ogrJGEp+YpwTYnwWHbu7KSc52zIcaDK8Ehc x+skD2tkQODNb0ll046Q6w==; Date: Mon, 09 Sep 2024 22:03:51 +0300 Message-Id: <86mskgveco.fsf@gnu.org> From: Eli Zaretskii To: Sean Whitton In-Reply-To: <87h6aosofr.fsf@zephyr.silentflame.com> (message from Sean Whitton on Mon, 09 Sep 2024 18:54:16 +0100) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87a5l2evdn.fsf@zephyr.silentflame.com> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Whitton > Cc: philipk@posteo.net, stefankangas@gmail.com, acorallo@gnu.org, > juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Mon, 09 Sep 2024 18:54:16 +0100 > > Hello Eli, > > Any comments on v4? When I have time. > I'd like to commit to unblock Philip. Sure, but there's no rush. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 09 15:23:47 2024 Received: (at 69097) by debbugs.gnu.org; 9 Sep 2024 19:23:48 +0000 Received: from localhost ([127.0.0.1]:34203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snjzH-000805-Db for submit@debbugs.gnu.org; Mon, 09 Sep 2024 15:23:47 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snjzF-0007zr-0f for 69097@debbugs.gnu.org; Mon, 09 Sep 2024 15:23:45 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B09F7240103 for <69097@debbugs.gnu.org>; Mon, 9 Sep 2024 21:23:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1725909814; bh=e1Bnc/b3DuDyDICSEG65sTsgBsjz23BNadbjj4tlK2s=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=pU5zSHdZeJt2p8mHRH8QgHuB4AXO/JvYyvlh4uJclEO3iunUH47uzHoOBv4aLPecZ ZoMS0u2H2T4V2qgx68y5OS0ZfiB2jUr6sEZ1aXMkz47GIFy8K5i333rznHYjfnp8V1 KWsxCLcsGbjr+3zhhjj4e9WhtdGKMvEp2hLXKEoc2gkwTO+iItwS/bjXwlPuqyTXsN aHx1gmsKU0/AO1Xe+/hDkoVdiVqv2oZAfH+p5L0qArsLitfi3AtPXxaYGUKGpDXlx+ 3qBxxkivg+oTQ8rzBTFHM4ww+ceXp9Wf00r6bynzNBNmW0WEcbpMly89ZIQZgZGbVc Arlc1s/i3cbsw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X2cFK3ksSz9rxD; Mon, 9 Sep 2024 21:23:33 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87h6aosofr.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Mon, 09 Sep 2024 18:54:16 +0100") References: <871q9g8z8k.fsf@posteo.net> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Mon, 09 Sep 2024 19:23:32 +0000 Message-ID: <87bk0wmy17.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Sean Whitton writes: > Hello Eli, > > Any comments on v4? I'd like to commit to unblock Philip. Thanks! Here is my updated patch. If you want to, you can push both at once so that we can close the issue more quickly as soon as Eli has time to take a look: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-kill-region-kill-the-last-word-when-there-is-n.patch >From 0f19dadb75a01873cb3f40a6addd825e63c266ce Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 3 Sep 2024 18:29:56 +0200 Subject: [PATCH] Allow 'kill-region' kill the last word when there is no region * etc/NEWS: Document the new user option. * lisp/simple.el (kill-region-dwim): Add new option. (kill-region): Respect 'kill-region-dwim'. (Bug#69097) --- etc/NEWS | 7 +++++++ lisp/simple.el | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index add438e8b6a..8cde2c294a9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -129,6 +129,13 @@ Unix-words are words separated by whitespace regardless of the buffer's syntax table. In a Unix terminal or shell, C-w kills by Unix-word. The new commands 'unix-word-rubout' and 'unix-filename-rubout' allow you to bind keys to operate more similarly to the terminal. + +--- +** New user option 'kill-word-dwim'. +This option will modify the fall-back behaviour of 'kill-region' if no +region is active, and will kill the last word instead of raising an +error. + * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index bbb13c1b471..d1be33ce87d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5817,6 +5817,19 @@ kill-read-only-ok :type 'boolean :group 'killing) +(defcustom kill-region-dwim nil + "Behaviour when `kill-region' is invoked without an active region. +If set to nil (default), the behaviour of `kill-region' stays the same. +If set to `emacs-word', then kill the last word as defined by the +current major mode. If set to `unix-word', then kill the last word in +the style of a shell like Bash, disregarding the major mode like with +`unix-word-rubout'." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil)) + :group 'killing + :version "31.1") + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5843,21 +5856,35 @@ kill-region (To delete text, use `delete-region'.) Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current + `region', the function ignores BEG and END, and kills the current region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." + this command always kills the current region. It is possible to + override this behaviour by customising the user option + `kill-region-dwim'." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) + (cond + ((and kill-region-dwim (not (use-region-p))) + (list beg end kill-region-dwim)) + ((not (or beg end)) (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + ((list beg end 'region)))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((memq region '(unix-word emacs-word)) + (let ((end (point))) + (save-excursion + (if (eq region 'emacs-word) + (forward-word -1) + (forward-unix-word -1)) + (filter-buffer-substring (point) end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) -- 2.45.2 --=-=-= Content-Type: text/plain -- Philip Kaludercic on siskin --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 09 15:48:31 2024 Received: (at 69097) by debbugs.gnu.org; 9 Sep 2024 19:48:31 +0000 Received: from localhost ([127.0.0.1]:34224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snkNC-0000ml-TW for submit@debbugs.gnu.org; Mon, 09 Sep 2024 15:48:31 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:33150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snkNA-0000mY-OA for 69097@debbugs.gnu.org; Mon, 09 Sep 2024 15:48:29 -0400 DKIM-Signature: a=rsa-sha256; b=hJXcYtiMt5VgCZLXjU5U8J0alxU1Yua0QlywRG3W0Y4ZR+vpdaqYRtk3+BOT54SoL1tkVSxv2WgqbuFWTigk9aLGWxOBErqG+qic+70yL3/IbblttzwxVA2MiPxFL3lA7QMiwZHXPY398r5rLoH59h1Zm087Vsuk3UDLWV8qb17ZlVFhGe6MI7ZU0gk3FPqGQIhtlVFtIAUlARzHA1o3QSyRK/sT+qPly7hn2IGHuxCxp78QFTvaKN5q19dwL/Zwfw6yIktmZDAdqmQ83bHGscrg9IzEF12xCL+9djcFki+t3260dxcNHkCy//43r4Z8J4qrSLs+SGp7a1ayXKi4UQ==; s=purelymail1; d=spwhitton.name; v=1; bh=q+i5AhTdYBgNBkihhZfc6mN+F1MJF6XPs8JZMmBRPg8=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=gKj9lBzjhI+6R0Gv6RZYMZjku/IPBl3VOjdkmOAedFwJ3j+4TDCauotmSLWrH/CMZXuu5Un7J+jjJwFJDMyKmmFg9kR8VxTYvqXQC7XxQBZzjZ987y6suro0XQSx98qIZukKrgp9Ydcde6N7C8ZlTW6iWbjxvR8sR4XXzA09y1sRSzlR1tgt44a1P63oTd/M0qgWJhgA0BKzHpq1AvSVHPHsEjUiLjJ+/WTfqILVsmM//DggUh8fzl+fbJIFGCVy8v03gYcc33L0ZIJKCYAblQEm6LSKlmMCwCyPO51tqAOu6qVlqv289OghmWc4j0CA0On+AcpXIQdAD9fGF8Oz8g==; s=purelymail1; d=purelymail.com; v=1; bh=q+i5AhTdYBgNBkihhZfc6mN+F1MJF6XPs8JZMmBRPg8=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1170104955; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 09 Sep 2024 19:48:18 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 63BFB949A28; Mon, 9 Sep 2024 20:48:17 +0100 (BST) From: Sean Whitton To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86mskgveco.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Sep 2024 22:03:51 +0300") References: <871q9g8z8k.fsf@posteo.net> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <86mskgveco.fsf@gnu.org> Date: Mon, 09 Sep 2024 20:48:17 +0100 Message-ID: <87a5ggsj5q.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 09 Sep 2024 at 10:03pm +03, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: philipk@posteo.net, stefankangas@gmail.com, acorallo@gnu.org, >> juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org >> Date: Mon, 09 Sep 2024 18:54:16 +0100 >> >> Hello Eli, >> >> Any comments on v4? > > When I have time. Sorry, thought you might have missed it. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 05:13:18 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 09:13:19 +0000 Received: from localhost ([127.0.0.1]:44783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spOqE-0008G2-G5 for submit@debbugs.gnu.org; Sat, 14 Sep 2024 05:13:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spOqC-0008Fl-TT for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 05:13:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spOpv-0003nv-BY; Sat, 14 Sep 2024 05:12:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=65/9GJENOH46IIs/RGDFiO4nuNw9m19sK8xb8UBPAYI=; b=dTd8CHTBFwOp Rg2JRb6hdsy9aosF9Kx91dXjSuIDpPbC5iLoqYB/Esa2p9mOQwhwBDpY7Sw+QEcqwZQjqiabjUjFG F1TzK5G/yyJIZydHXUt5FeeROVr+G0zuVjTpgbyie0tX2bwLDPZTKd4GvavudOol0w6Eufl/7lCbX SWXexIHvhsjaWH+bbVubauDHJUexy6xH64IyIuDTL0aPaCbbCtIas7zl77ifv+bBtZWEd2BWl9zg3 SRttoIw8qC6jGpVD8tm1r+fc21kyRm7osHghUqZhrdghZL8oJgTBcgAEfq8BxLgiA+djRlt6nL862 2c1Vs1fhsKXY5WVszSLGvQ==; Date: Sat, 14 Sep 2024 12:12:49 +0300 Message-Id: <86plp6ha3y.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87bk0wmy17.fsf@posteo.net> (message from Philip Kaludercic on Mon, 09 Sep 2024 19:23:32 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <86ikzqbzac.fsf@gnu.org> <87seujf8bb.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: Eli Zaretskii , stefankangas@gmail.com, > acorallo@gnu.org, juri@linkov.net, rms@gnu.org, 69097@debbugs.gnu.org > Date: Mon, 09 Sep 2024 19:23:32 +0000 > > > Hello Eli, > > > > Any comments on v4? I'd like to commit to unblock Philip. Thanks! > > Here is my updated patch. If you want to, you can push both at once so > that we can close the issue more quickly as soon as Eli has time to take > a look: I'm okay with installing both patches, but please first fix the few minor nits below: > +--- > +** New user option 'kill-word-dwim'. > +This option will modify the fall-back behaviour of 'kill-region' if no ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "This option, if non-nil, modifies the fall-back behavior..." > +region is active, and will kill the last word instead of raising an > +error. This should also say explicitly that users who turn off Transient Mark mode will need to either activate the region ("C-x C-x" etc.) or invoke the new word-rubout commands by hand, since otherwise the region is never active for them. > +(defcustom kill-region-dwim nil > + "Behaviour when `kill-region' is invoked without an active region. > +If set to nil (default), the behaviour of `kill-region' stays the same. ^^^^^^^^^ ^^^^^^^^^^^^^^ "behavior", US English spelling. The same as what? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 07:28:09 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 11:28:09 +0000 Received: from localhost ([127.0.0.1]:44959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spQwi-0007Tm-S8 for submit@debbugs.gnu.org; Sat, 14 Sep 2024 07:28:09 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:45990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spQwe-0007T8-7d for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 07:28:07 -0400 DKIM-Signature: a=rsa-sha256; b=UzQnWT/zZrE7qZOLIgviwWphDPtkeYAbqnL5NXKYZEtfFDtsYH1W5vcEiZZSVlewIlyvGXHc3CsRmd2tx45tcBaMGgbeadSDUG8pxoTFTt9kWndL/UeJkX2gkD+LsT8a+jXNtsvowTPt4KcilXH97kWidF8Kl+8zzrWP7r7bJZkO7csvcqZvhzsnJk25F+FDem+g4mB7EyntdscNBwuE611jwqPKCZkZQWcUqRKmGN+D9iiZZJgbkipgCOvWq91zJ2/PQInpXHPMAO9wZP/THwON0QUXM/1wHo5YydMSWWWi5N15Yk75TpDp+EY3W8u0Btia4v0KEiiheElp38rz3A==; s=purelymail2; d=spwhitton.name; v=1; bh=+t0pgb1iXLvTlDrzEqVBEYQ1qQt587waSHXSEyR/HwU=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=q9+RXZbiGthsAmacX/kzoy8wX07khx5j5EkLinAPD07+EWd0gJm4uYuYTZRBDGmCqkvTRqPtaDfTUX1s3w2IPUwPYy7DqRtF73AXKnzoT9OkCDsr52dSAg9kYRhuFS4uSST8AjXO1lszM4/e1I3LsvYnowdGcbE3oRzYqYGDwI0IYIFXkT6eiG3eLNne90J4c3nXnnn6J+xK58LOZ63xPqvQ8jb94GHrhNQ1kJDuMqi40KDOl7TMKU0cSq4r5TNvQlU6q06yKjPrY5/RzkVsDFVCF+Se+qAtz7Wf7Kgfi5Tktcq96ASdjoL5b+nIyN8zCpkdJqBQXBdGCMRYLqeCkw==; s=purelymail2; d=purelymail.com; v=1; bh=+t0pgb1iXLvTlDrzEqVBEYQ1qQt587waSHXSEyR/HwU=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1648649721; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Sep 2024 11:27:44 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id EC5CD9417C1; Sat, 14 Sep 2024 12:27:42 +0100 (BST) From: Sean Whitton To: Eli Zaretskii , Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86plp6ha3y.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Sep 2024 12:12:49 +0300") References: <871q9g8z8k.fsf@posteo.net> <867cbu9uce.fsf@gnu.org> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> Date: Sat, 14 Sep 2024 12:27:42 +0100 Message-ID: <87r09m8ogh.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: acorallo@gnu.org, stefankangas@gmail.com, rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Thanks for the re-review, Eli. I've pushed my patch. > This should also say explicitly that users who turn off Transient Mark > mode will need to either activate the region ("C-x C-x" etc.) or > invoke the new word-rubout commands by hand, since otherwise the > region is never active for them. This seems like Philip might want to think a bit about what it is more helpful to say, so I'll hold off on editing and pushing his patch myself. -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 09:40:06 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 13:40:06 +0000 Received: from localhost ([127.0.0.1]:45139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spT0Q-0006lr-4U for submit@debbugs.gnu.org; Sat, 14 Sep 2024 09:40:06 -0400 Received: from mout02.posteo.de ([185.67.36.66]:49177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spT0N-0006l8-7z for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 09:40:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C6A5E240103 for <69097@debbugs.gnu.org>; Sat, 14 Sep 2024 15:39:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726321185; bh=D1veLSlZinL6R/VamlOOXiqb+fxqdnFl6MCkLWO8cCM=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=V6nyM8iWC0GGsXVzLfQAuVL3EUQqezu2kPF28dUTeQApju/PW1v9jXEfy0V3+2wgI drWp9O2SOrOWz0Jld82gv2WrK1fETG44D427o3QrRvWS0Sr8tWcT5pySMTFZ6/t3MW r730hax3bJplEGDjOKLIPIrQ4AqWD6k0E6dbImrsNNIhHETzmeJnH/gBMF+/e8JLP/ on/D5K+apGCNNMRD33ftVDGHEK6b5mnzUC4r/h9gL8FlzjjjkPUVSVI03aNs+hgLDx 4hgbcEqItZGsFaB7cl8/n03oWyTGWSGGS5VhrWL/rbeOiRgvulwHfmXAMDhU1Nzndb JUT5V3/hjBRKQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X5XNJ0QKGz6tsg; Sat, 14 Sep 2024 15:39:43 +0200 (CEST) From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87r09m8ogh.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Sat, 14 Sep 2024 12:27:42 +0100") References: <871q9g8z8k.fsf@posteo.net> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Sat, 14 Sep 2024 13:39:43 +0000 Message-ID: <87ttei2w2o.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, Eli Zaretskii , acorallo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Sean Whitton writes: > Hello, > > Thanks for the re-review, Eli. I've pushed my patch. > >> This should also say explicitly that users who turn off Transient Mark >> mode will need to either activate the region ("C-x C-x" etc.) or >> invoke the new word-rubout commands by hand, since otherwise the >> region is never active for them. > > This seems like Philip might want to think a bit about what it is more > helpful to say, so I'll hold off on editing and pushing his patch > myself. How about --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-kill-region-kill-the-last-word-when-there-is-n.patch >From 2fb36ab68eb177e232b9ee4b0d5ea105b9aa9f16 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 3 Sep 2024 18:29:56 +0200 Subject: [PATCH] Allow 'kill-region' kill the last word when there is no region * etc/NEWS: Document the new user option. * lisp/simple.el (kill-region-dwim): Add new option. (kill-region): Respect 'kill-region-dwim'. (Bug#69097) --- etc/NEWS | 9 +++++++++ lisp/simple.el | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index add438e8b6a..f01c6e2b3cd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -129,6 +129,15 @@ Unix-words are words separated by whitespace regardless of the buffer's syntax table. In a Unix terminal or shell, C-w kills by Unix-word. The new commands 'unix-word-rubout' and 'unix-filename-rubout' allow you to bind keys to operate more similarly to the terminal. + +--- +** New user option 'kill-word-dwim'. +This option, if non-nil, modifies the fall-back behaviour of +'kill-region' if no region is active, and will kill the last word +instead of raising an error. Note that if you have disabled Transient +Mark mode you might prefer to use 'unix-word-rubout', as this feature +relies on there being an active region. + * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index bbb13c1b471..f05ded36c22 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5817,6 +5817,19 @@ kill-read-only-ok :type 'boolean :group 'killing) +(defcustom kill-region-dwim nil + "Behaviour when `kill-region' is invoked without an active region. +If set to nil (default), then the behavior `kill-region' will not +change. If set to `emacs-word', then kill the last word as defined by +the current major mode. If set to `unix-word', then kill the last word +in the style of a shell like Bash, disregarding the major mode like with +`unix-word-rubout'." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil)) + :group 'killing + :version "31.1") + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5843,21 +5856,35 @@ kill-region (To delete text, use `delete-region'.) Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current + `region', the function ignores BEG and END, and kills the current region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." + this command always kills the current region. It is possible to + override this behaviour by customising the user option + `kill-region-dwim'." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) + (cond + ((and kill-region-dwim (not (use-region-p))) + (list beg end kill-region-dwim)) + ((not (or beg end)) (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + ((list beg end 'region)))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((memq region '(unix-word emacs-word)) + (let ((end (point))) + (save-excursion + (if (eq region 'emacs-word) + (forward-word -1) + (forward-unix-word -1)) + (filter-buffer-substring (point) end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) -- 2.45.2 --=-=-= Content-Type: text/plain And I think that you can already push your change, and I can follow on later. -- Philip Kaludercic on siskin --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:05:44 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 14:05:44 +0000 Received: from localhost ([127.0.0.1]:47422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTPE-0000Sl-0a for submit@debbugs.gnu.org; Sat, 14 Sep 2024 10:05:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTPC-0000SV-2W for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 10:05:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spTOu-0000Tx-Nm; Sat, 14 Sep 2024 10:05:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CN5mvwj6GS/YuQSF8Rv80rXctKAdYKxdMwGZ2Jy6jMk=; b=DkQklO6N7kK3 A5+xifXazry1If0kWqi3BX9mBcOFoUkYQ2Yux9nHpFNvju08Ggy1riu2fN/hFbc0T6JSzvj0T+rvq F68GEIqIoO64LQkOM8eO2n0FU0oGCXKYLoc/2p14s1OmPaHscgLzqJbCt5BjhAmvFMEDIUtAq1mi+ C8oMizZ4E6CYVphyTtWOpgOtex/IBYHm0WraqhbezSaqwkAgDtsTm0Gsr6l5G+CwmknmgrLXfImd8 9qT/hZNoE7xZh68gNwZ8Gt+3WImUhMwlJM6JygXxpclNsS5+Wp1DkpFlYkcjmTaHcSwYd7iaxMLkT BTDeq94MCbWjMqw+wRTbMw==; Date: Sat, 14 Sep 2024 17:05:12 +0300 Message-Id: <86seu2fi07.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87ttei2w2o.fsf@posteo.net> (message from Philip Kaludercic on Sat, 14 Sep 2024 13:39:43 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87cyllg57r.fsf@posteo.net> <87zfopbxdk.fsf@zephyr.silentflame.com> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org, > juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org > Date: Sat, 14 Sep 2024 13:39:43 +0000 > > > This seems like Philip might want to think a bit about what it is more > > helpful to say, so I'll hold off on editing and pushing his patch > > myself. > > How about LGTM, but there's still a "behaviour" there... From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:13:27 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 14:13:27 +0000 Received: from localhost ([127.0.0.1]:47477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTWh-0000wq-2W for submit@debbugs.gnu.org; Sat, 14 Sep 2024 10:13:27 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTWe-0000wZ-R7 for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 10:13:25 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BAD99240027 for <69097@debbugs.gnu.org>; Sat, 14 Sep 2024 16:13:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726323188; bh=6byuGrDFCjAnupN69X7SZY192cXZXOo/u0tQijIOFyM=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=NDssdAo25YvzqHw7ljcveXjrMjT45PsB4jhOaoncdzEFUWkuMRkHwUuRh0u8wIPeF CKTyruzhb0WVC2B4XNOduz6rWHzVkxg3+GRYUbtzSRN5Xe91NfQ5+V7M7hgVB/+Tdd 33/7g0KmlGmaAHdjIM29IlWINRGmwGtCClA0yXrJx8WPljTj7zJDwUZ9FYHywyDZCa ru+YSSwdeRG9AZkSFZEZmyHmFmMBmJG7P8aGc0JBj3+2t72eu08JIUgIMQSSNCvFDk FaaqDQqBQnI3ZtaPgWT+T2ehYLYVoEpAzoVZMspuzCVHln8J1+XfT8kJkbWqSgBUEQ GqahQsI5qHa1A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X5Y6p6Jtwz6tw1; Sat, 14 Sep 2024 16:13:06 +0200 (CEST) From: Philip Kaludercic To: Eli Zaretskii Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86seu2fi07.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Sep 2024 17:05:12 +0300") References: <871q9g8z8k.fsf@posteo.net> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Sat, 14 Sep 2024 14:13:06 +0000 Message-ID: <87plp62uj1.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , rms@gnu.org, 69097@debbugs.gnu.org, >> juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org >> Date: Sat, 14 Sep 2024 13:39:43 +0000 >> >> > This seems like Philip might want to think a bit about what it is more >> > helpful to say, so I'll hold off on editing and pushing his patch >> > myself. >> >> How about > > LGTM, but there's still a "behaviour" there... Eh, sorry! I double checked the patch this time: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-kill-region-kill-the-last-word-when-there-is-n.patch >From 2b92dcb771646f5ff5b7f574c9ebeada9e8593a5 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 3 Sep 2024 18:29:56 +0200 Subject: [PATCH] Allow 'kill-region' kill the last word when there is no region * etc/NEWS: Document the new user option. * lisp/simple.el (kill-region-dwim): Add new option. (kill-region): Respect 'kill-region-dwim'. (Bug#69097) --- etc/NEWS | 9 +++++++++ lisp/simple.el | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index add438e8b6a..3984670bff7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -129,6 +129,15 @@ Unix-words are words separated by whitespace regardless of the buffer's syntax table. In a Unix terminal or shell, C-w kills by Unix-word. The new commands 'unix-word-rubout' and 'unix-filename-rubout' allow you to bind keys to operate more similarly to the terminal. + +--- +** New user option 'kill-word-dwim'. +This option, if non-nil, modifies the fall-back behavior of +'kill-region' if no region is active, and will kill the last word +instead of raising an error. Note that if you have disabled Transient +Mark mode you might prefer to use 'unix-word-rubout', as this feature +relies on there being an active region. + * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/simple.el b/lisp/simple.el index bbb13c1b471..fb7dad50a13 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5817,6 +5817,19 @@ kill-read-only-ok :type 'boolean :group 'killing) +(defcustom kill-region-dwim nil + "Behavior when `kill-region' is invoked without an active region. +If set to nil (default), then the behavior `kill-region' will not +change. If set to `emacs-word', then kill the last word as defined by +the current major mode. If set to `unix-word', then kill the last word +in the style of a shell like Bash, disregarding the major mode like with +`unix-word-rubout'." + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) + (const :tag "Kill a word like Bash would" unix-word) + (const :tag "Do not kill anything" nil)) + :group 'killing + :version "31.1") + (defun kill-region (beg end &optional region) "Kill (\"cut\") text between point and mark. This deletes the text from the buffer and saves it in the kill ring. @@ -5843,21 +5856,35 @@ kill-region (To delete text, use `delete-region'.) Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is - non-nil, the function ignores BEG and END, and kills the current + `region', the function ignores BEG and END, and kills the current region instead. Interactively, REGION is always non-nil, and so - this command always kills the current region." + this command always kills the current region. It is possible to + override this behavior by customising the user option + `kill-region-dwim'." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn (let ((beg (mark)) (end (point))) - (unless (and beg end) + (cond + ((and kill-region-dwim (not (use-region-p))) + (list beg end kill-region-dwim)) + ((not (or beg end)) (user-error "The mark is not set now, so there is no region")) - (list beg end 'region)))) + ((list beg end 'region)))))) + (condition-case nil - (let ((string (if region - (funcall region-extract-function 'delete) - (filter-buffer-substring beg end 'delete)))) + (let ((string (cond + ((memq region '(unix-word emacs-word)) + (let ((end (point))) + (save-excursion + (if (eq region 'emacs-word) + (forward-word -1) + (forward-unix-word -1)) + (filter-buffer-substring (point) end 'delete)))) + (region + (funcall region-extract-function 'delete)) + ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. (if (eq last-command 'kill-region) -- 2.45.2 --=-=-= Content-Type: text/plain If there is nothing left, then Sean can push both changes at once. -- Philip Kaludercic on siskin --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:25:24 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 14:25:25 +0000 Received: from localhost ([127.0.0.1]:47532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTiG-0001m5-Ho for submit@debbugs.gnu.org; Sat, 14 Sep 2024 10:25:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTiD-0001go-Hw for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 10:25:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spThw-0003Dj-Tf; Sat, 14 Sep 2024 10:25:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=75jPQw+LtX/VIU21MYROGQjUqvwR3k6wHLMc0FZTfBE=; b=l1WEP89jEuJS 4vnAobEwXaGz/C7hf+TMdvqEBP2Ub/HIqTQzClA3nffDn/Wzt/SFIxJmuKzcNDNlgwmvg1MJyy2nO Ip14+lEVJn2TaEjEAT77fPQDeMzbacKjYJYb/HT5D/wTXMBONE7OlDedX12h6hdzTvQNtWh6y068y /Df0k62Hr39GrwJaXgyl3HCYKoadIj+R1wre89JymdnDDwKEFNdl99Gl90D6/4iMocIY+hWReINu/ xKroMwUxogspsq7FsEIMMt9bjyx0MK9089SbvrZ3kXaWtQasKX7u5OP4raAsSot4zVn3bZhHrm7nG AvRMeSEKuW/zf58vbsXqqQ==; Date: Sat, 14 Sep 2024 17:24:53 +0300 Message-Id: <86h6aifh3e.fsf@gnu.org> From: Eli Zaretskii To: Philip Kaludercic In-Reply-To: <87plp62uj1.fsf@posteo.net> (message from Philip Kaludercic on Sat, 14 Sep 2024 14:13:06 +0000) Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command References: <871q9g8z8k.fsf@posteo.net> <87seuhbx87.fsf@zephyr.silentflame.com> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: rms@gnu.org, 69097@debbugs.gnu.org, juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philip Kaludercic > Cc: spwhitton@spwhitton.name, rms@gnu.org, 69097@debbugs.gnu.org, > juri@linkov.net, stefankangas@gmail.com, acorallo@gnu.org > Date: Sat, 14 Sep 2024 14:13:06 +0000 > > >> How about > > > > LGTM, but there's still a "behaviour" there... > > Eh, sorry! I double checked the patch this time: Thanks, feel free to install. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 12:10:27 2024 Received: (at 69097-done) by debbugs.gnu.org; 14 Sep 2024 16:10:27 +0000 Received: from localhost ([127.0.0.1]:47697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVLv-0007xo-FD for submit@debbugs.gnu.org; Sat, 14 Sep 2024 12:10:27 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:42140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVLs-0007uF-Ey for 69097-done@debbugs.gnu.org; Sat, 14 Sep 2024 12:10:26 -0400 DKIM-Signature: a=rsa-sha256; b=jwMP19e32w+Bbj6R3Msj4lSwVGSfNXr3BvpSZe05o3Pu0PhcMkTX2FOpHtT74nMHXOQzH00aDlTeDskd9XvIpHV7NXC+3ap7Ci9vdH0gk57pR9GbZnCJ4oq+lM70CEedlUP4qDhAtI5b+FcGEtqGrv3u6zzDTQFFG7Ny89RyjqSdao/KQ2pMLbAS/pDUeMv9oUSt5RMwJ6pz+lLurDUqmywrgYRbbifpnAkT/zqA/7bS022nSdr2fZhf+V+/PMCWjRGRp+UVfYIEXlhCxzgfcxkk8y0VC4uQv2m5xc1hxnNJ1p/S23o5zw4BW0Hp6bdU205WmiRR4CDA+43Nmn9rLQ==; s=purelymail2; d=spwhitton.name; v=1; bh=UlN93AV0COh4ChWmyi9NnGU+XRKKUDuMpSul0gb1OC0=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=TMlyjs9UgF6e8rUPnAS5AZ9oY30IFvAONtc8j4gFKhUb6/VfIK6G0sZI2xZkrDfi8xZobQYlaszXKzHGLQvZzo16yQ6demqu6bW0NA9lP0eBhdAgNXLj3zaSt0P9xGZ1bTcMcmHWgQhkQlM4q5A3L6QtSt0zPSOaMB2mCBFxhf6mqnzAbvaaDTi+WZ91wVGiRrc3/JtMVs/52phJ18NlRZV5xrqIRTW0x52k/JKfEIorCj4j3hRuGZcE5EHn1UAN7a/mlVMEKcnjlnOr2hrFcIjwk/KOX4kK7ZE8qae1lq3x37CjhAKrvlR1HJomt6hvkU9tpi6mluRR8dghhav7RQ==; s=purelymail2; d=purelymail.com; v=1; bh=UlN93AV0COh4ChWmyi9NnGU+XRKKUDuMpSul0gb1OC0=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097-done@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -598236863; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Sep 2024 16:10:05 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 62B3D94993B; Sat, 14 Sep 2024 17:10:04 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87plp62uj1.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 14 Sep 2024 14:13:06 +0000") References: <871q9g8z8k.fsf@posteo.net> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> Date: Sat, 14 Sep 2024 17:10:04 +0100 Message-ID: <87jzfe8bdv.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097-done Cc: 69097-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Installed. I fixed a couple of typos in your commit, and pushed another commit doing some reformatting for readability. Hope you like it! -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 12:27:16 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 16:27:16 +0000 Received: from localhost ([127.0.0.1]:47721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVcC-0000SS-Dr for submit@debbugs.gnu.org; Sat, 14 Sep 2024 12:27:16 -0400 Received: from mail-westusazolkn19010020.outbound.protection.outlook.com ([52.103.2.20]:5879 helo=BYAPR05CU005.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVcA-0000S2-46 for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 12:27:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VKsoMVBPtTO88q7UX99uA07j0e1810Rq71Bl/9SiKoPiDNSmHKAP+j22gLG+Z0o2pstgI0lCPjPDI986GWl6SsdjRIVKbEXUmFNHZc0mSplu4H+hxP5dZL02Q4bOqmzb3svHo075wHBITOMQiiKau2p86AnD7ULYdAmgiLQFSY6Xf6Z2b50ZEDRY4N9tTSla9tXHx9xoU4I+tXCSCS0IXPDDMYxGJPlcT6Wxp3F0jL3Fg0ZAdnGYR6POgdnR//3YfLt79QdKIaph3G58r+RNvXjI6f6rwrH7PS7y2sJSEZretQh/nXDaHQKMEsFmyeYsXV37hJUHwjIzb/xIxmjMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5Kdyljv75FajB3FqGQw9IlAl5HVFO/FV7gBMvhYGy1k=; b=xR6zX+ZSAYh77ta4Tl60BW4jA2A5LFBbh7LyRO/14qUmxrAG2aLjJAKoDy9GQECtRQhGuRGs9A9lK5Era1HrJqr+ABAwU+Mrn2Rle3EvPLVkkw3JFoKy9VYsHHpK5Mmtko6My5Mv8VXAm0C2sTPRA5AeV02mDQHjKCE3o0xEynknkVsEBzsXA+YHasKOaI9pIu80IhHehP/sqgmOzoJHbjb8oAeWY/58nZpnPzGGYPxxRtq32zTQ4oceGUWL+TcOuYltjNcylbMXU+XwOCnNAcWWQfmy/tudrWNoJqrDXfdpCZ1Gfz6dUKSlUDFWMEYUr3Yg141GVi3P8EmEq3HqaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5Kdyljv75FajB3FqGQw9IlAl5HVFO/FV7gBMvhYGy1k=; b=LPlSnOTbPZMHoac2Kq84nOiF0MGvFM3eS5NgMLy7ebgxxFAeF7uZNBnATWLrdVIHSbhDAnchu/SCZi6YKKgbqQRMS+Ssn2EGS7/um/NyL7wvVLDquq+WL5b9wPTkDa2bY+q2wU8u2YCjj1e7k7GMf8LsAdWRM7PRfBwcQFquozhBqr7q7qFX6z0bANBFkcWWdh9CU/6lkYYOGxDTO7TqKtl6C9hzDdwaOUtIgeYuAUyIw3De4uBnpBAPsbbWx58bAdIQ0KPVnE5/W5aZybj5K+jWPp4JP43TfiyQNkLhr78T5hWzKcyBid/SXsVxAWF1orwZMW9LJQT6fC57rjv64w== Received: from MW4PR02MB7410.namprd02.prod.outlook.com (2603:10b6:303:7f::17) by CY8PR02MB10187.namprd02.prod.outlook.com (2603:10b6:930:56::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.21; Sat, 14 Sep 2024 16:26:56 +0000 Received: from MW4PR02MB7410.namprd02.prod.outlook.com ([fe80::40b3:f272:de33:3443]) by MW4PR02MB7410.namprd02.prod.outlook.com ([fe80::40b3:f272:de33:3443%4]) with mapi id 15.20.7962.022; Sat, 14 Sep 2024 16:26:55 +0000 From: German Pacenza To: 69097@debbugs.gnu.org Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87jzfe8bdv.fsf@zephyr.silentflame.com> (Sean Whitton's message of "Sat, 14 Sep 2024 17:10:04 +0100") References: <871q9g8z8k.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <87jzfe8bdv.fsf@zephyr.silentflame.com> Date: Sat, 14 Sep 2024 13:26:49 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-ClientProxiedBy: SCYPR80CA0046.lamprd80.prod.outlook.com (2603:10d6:300:146::14) To MW4PR02MB7410.namprd02.prod.outlook.com (2603:10b6:303:7f::17) X-Microsoft-Original-Message-ID: <87h6aifbg6.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR02MB7410:EE_|CY8PR02MB10187:EE_ X-MS-Office365-Filtering-Correlation-Id: a6591a66-69b2-4f95-73a0-08dcd4da0b78 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199028|15080799006|19110799003|8060799006|5072599009|7092599003|3412199025|440099028; X-Microsoft-Antispam-Message-Info: NDm9dYOi8v66SDxwUhagpvQP5nmBJt1qRqMUNMxNPEYb1NXJWfgcKoPnZpeF6+kNeT5mW8SVCKuX4Nx7gJWDl/p9Q0m6Pl7eVJDedIcYs8ufd/afRNT+cA+/8npP7sntMyXUfdwpODfF+Sr1yektCvLw64RH02Ee9YXIt6hcSR66Zb58hWgB3LQ1IgtDtgeEcDBOPtwxIEbJShkRUNZ7ECckyFDzgCYtZdsrP2vl9roiBZjrOUaLqrcvVvojV4wk5LsQ7gLh/KylPpuV94ScOCynEN+ORmz7z8PPYx0g6F4Sb2yBoZLkB3Ar9IxQu7qsuPpEIqcKtnQhXu/w48zQMqeG28gZkxNpWAHwc0GiO2TYb0l28XFJR7Eorvy+wvtXk1C6uz4Yx2T6ey+ppx7WVRDvOG9BrpIZN8xzqxSN84w8M8YXuDxlocQfnxf09G9p/9hWo4OOvA6INzVfKSM0atgjv5xGVy2w4buhO4RkfHEz7l+YmZu+PIs8lpFyakbCwD+4OYVEYlPX3enefphefPpxuSK20fck1xb08sl/U1epMAqYnLf1C9Zd8m0tFmlWzOj+d1FjLBK5EmWi/qrZ/yRSPwyCIeOUrFPqkdQPUCU5RVTZM7tLrmdW5qFwdd3PzQ6lGXbQsX9KtOO1fhDlgb6b/8eax3D2+USC86E5nEKfD+ztAp9OEf1mhuktAwy1uCUYN9OiDxoKnw63tdES9dj4eD4l4eTnVduw5tghUdM= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?g1AyO7jrFx+cSt82ilz8ZomKabq4QsyIn0V/ERpDd83tYdZm2cU15jkIlZBp?= =?us-ascii?Q?EGseY/428dFdyCAyjhK2QfqEz8kOTxmNVUTBqz9S16YWhsTfUNVftFjXvmvj?= =?us-ascii?Q?u/HXG8t163OpUSbyxQK/i8P7uwvqv9FMYmV4v/9LbU4KzeTbceKhJWzjPSmh?= =?us-ascii?Q?Tg8FWblds2R8C9V4trXRKkJJaDMGnlT5pS0ry8TaKC6Mr9lD5Nm6NR2w5Axa?= =?us-ascii?Q?0rE5ytFX7CQV3LyOgafhj1vuCISgNM+Qtlse8fvFxPMWVNzGAICaJ7sC5hPp?= =?us-ascii?Q?t6nZjOHTmb1ir9r4ccCMRcTmDTEi1KMC0SMd1tkLObka/RnBDVNc8wgYL9Fv?= =?us-ascii?Q?6w99qDed3KTRe4gcL57uXXxid9FbkzCTV5Qa4spzRUPUSqI4oSTg9xFzBUzR?= =?us-ascii?Q?FhmQkwwvVxASqLTdLuRsdALwCZxxNtRU8xrxIFLWxbKKUr0NcR1f6XBa554Z?= =?us-ascii?Q?RlGMwb7YNQkvchTJWY1NjxRni19FSCVtaOVC5+pqdsj/rlZ/HloGXANnTIww?= =?us-ascii?Q?fhxU6t951BxL0+EvLcL8xAl9HO16i4dH67u+sm57SNuzsr7k0lW9lSZDrVCv?= =?us-ascii?Q?95UfEwDbtK4Tki9H6IA4ocFOQVPCQPvi1/fHGR0ga5r64vByX4ldrp+trVa9?= =?us-ascii?Q?LJVm8ceZgM9NHvi4K8guJZdRvcAfrZUhnWNmZv76bICxP1t74DE1OuZdjdO9?= =?us-ascii?Q?btEfRJgcfiw19OaEnlTdRiv5fm8FCOw/tPBlmfg5o62jU8HtLUgdtXkjCzCW?= =?us-ascii?Q?O7dHkoLbuW3er2hwnOOKdvtoq5mAxi4iucBSXAgtpuPsZpoobohBfIfI38RP?= =?us-ascii?Q?xFV4hyeZCWgnGIVKeIxuhqj9aAEQn8fG0JtlRXdGX9Pkf91KPi+ZcCQkhHA/?= =?us-ascii?Q?mwBQW3RXvCIwxIQwZMfN3NjeoyOF+POAaL9lqcvG+hYCCM5Q3SJHHizUje7e?= =?us-ascii?Q?uVRNMumrJ1Cqq+Pbat2ONxPZiVl2B5hwf/pJyMaotAMrkvMwAHrPvGA9Cyp6?= =?us-ascii?Q?vlTUETm5B0sUIkIxyGAm65sKtKin4o9obZOR/E302IAUSQkf1wGeymzkF76X?= =?us-ascii?Q?0YHa6Pdk22h31HdcfO/7olzSUFNjL1O+0tyOqhdik9e6FMQCQzEaBFT6aPIT?= =?us-ascii?Q?4rndKvaxf4Y5kW+nApoPCIb2yRztgpTYbBGQKlRvISngjx+iwg5t4JImjC7o?= =?us-ascii?Q?F3xLPexeLXKzeM/ukoBDWD3F6hqebni8ESkKUBUvMwlawlUvJFDI0cy/GYM?= =?us-ascii?Q?=3D?= X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-0f88b.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: a6591a66-69b2-4f95-73a0-08dcd4da0b78 X-MS-Exchange-CrossTenant-AuthSource: MW4PR02MB7410.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2024 16:26:55.5358 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR02MB10187 X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: News entry mentions kill-word-dwim instead of kill region-dwim -- German Pacenza Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [52.103.2.20 listed in list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (germanp82[at]hotmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (germanp82[at]hotmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [52.103.2.20 listed in wl.mailspike.net] 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, spwhitton@spwhitton.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) News entry mentions kill-word-dwim instead of kill region-dwim -- German Pacenza From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 12:36:25 2024 Received: (at 69097) by debbugs.gnu.org; 14 Sep 2024 16:36:25 +0000 Received: from localhost ([127.0.0.1]:47727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVl3-00010W-Du for submit@debbugs.gnu.org; Sat, 14 Sep 2024 12:36:25 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:45476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spVl0-000104-Aq for 69097@debbugs.gnu.org; Sat, 14 Sep 2024 12:36:24 -0400 DKIM-Signature: a=rsa-sha256; b=kSl1K3zxI/vn1kuJq8V0PfK3CDawiKFFuruHh6jBdz9j8Cou1IeS5zyqDPkedXWUNHZyvJJnRwGhYxEiFBz3lAl0pRP0M8fwJXMFEntlHxy6KGGtgZYouvFoc36nJ0NbD5uOTtl4m5/XEjEiy7bf4Kgg6bEP2DToKfXu/CP/2ds9waUurhNSfot8VMqnse20fRemFmMRndcjqo2t4zkhfLVKLqNbHjRrkvmMCPZZV9d1UUfUbcdy0WFiXIaF4fX3pnVRJb1GO75gdpBmDJVN1jlBFxpbJ0c+Gx8sbGqbn6jtBOrh/o9nW/IKJCOFpai4IARi9Ok397zDeJSEGNd18Q==; s=purelymail2; d=spwhitton.name; v=1; bh=52SsfleNEsDoF1w8kGmiGBtjm3JaLaAhjKg8LBe/90U=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=vnyiDKwKAh0KxuHd9tKRlp9nnkHTo9nfYPGVzPWvd23s3rUM8/yKPxpG/IP0dTAfNp8KY1KRoKxoC+zQYF77ZsLIxb3EhMunMbLoOUM97Ig3WOPUa07/tGInM/gaP4nLD4iA6lxExP4i1mX256SFYKACPsLLUZ43UWihlIthGidss11Gs7E3vlk/dFznn27TlXx1ecmfF4nPDgQofafoeN47zH0RfN8OgvGvveu1hFTpM0qTE/sv2VEs5CgyjwFjNsJurHGhQecG2skculdWZo2v+GZSg86eHf8pg36Ct7mCdmfUJIymFZTEcEpc6+HpftB2dmukkjsd0CAuipee1w==; s=purelymail2; d=purelymail.com; v=1; bh=52SsfleNEsDoF1w8kGmiGBtjm3JaLaAhjKg8LBe/90U=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 75174093; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Sep 2024 16:36:04 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 837D894993B; Sat, 14 Sep 2024 17:36:03 +0100 (BST) From: Sean Whitton To: German Pacenza Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: (German Pacenza's message of "Sat, 14 Sep 2024 13:26:49 -0300") References: <871q9g8z8k.fsf@posteo.net> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <87jzfe8bdv.fsf@zephyr.silentflame.com> Date: Sat, 14 Sep 2024 17:36:03 +0100 Message-ID: <87frq28a6k.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097 Cc: philipk@posteo.net, 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Sat 14 Sep 2024 at 01:26pm -03, German Pacenza wrote: > News entry mentions kill-word-dwim instead of kill region-dwim Thanks, fixed! -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 17:19:54 2024 Received: (at 69097-done) by debbugs.gnu.org; 14 Sep 2024 21:19:54 +0000 Received: from localhost ([127.0.0.1]:47866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spaBO-0008Tm-C5 for submit@debbugs.gnu.org; Sat, 14 Sep 2024 17:19:54 -0400 Received: from mout02.posteo.de ([185.67.36.66]:39075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spaBM-0008TV-2c for 69097-done@debbugs.gnu.org; Sat, 14 Sep 2024 17:19:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B3B4B240103 for <69097-done@debbugs.gnu.org>; Sat, 14 Sep 2024 23:19:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726348774; bh=sogK2uAl4rj80THFwMAHZrN6+o1spYRyyUw47Zt9wyY=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=VABlNz0gNSbDE40OIVXxgydeGY0FSXysiG1jrkrwqBXkK9UaZLUFtdDxNzONjOjnu VNSakbE+6WFBQhZDxSD6Ur4Awb7Ka74sKLJKfOgz4NVPAVEy9WtGIQLlqI/O8QNNr2 utHd+mFuQjTzHSAlPJlqgBZLkxKxfrQiejC3BrZkw+6wZX6zm1B+ACFzKZqi59hS8R 0U2ixrQVNmQnYTyQ9MAZeGa2xJDKK3jgwj5FKQD42x9MVU+Xd9XwncT57Ft0selFu0 yyDJ9nb5RcRJcwCri4dmGP5E+iYuQrge2MfICQGSC9UdNxX+p5LJ6UYSZpvCoSYNNp 7dlnk+0Wh6tfg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X5kZs6Fr4z6tvr; Sat, 14 Sep 2024 23:19:33 +0200 (CEST) Date: Sat, 14 Sep 2024 21:19:32 +0000 From: Philip Kaludercic To: Sean Whitton Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87jzfe8bdv.fsf@zephyr.silentflame.com> References: <871q9g8z8k.fsf@posteo.net> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <87jzfe8bdv.fsf@zephyr.silentflame.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097-done Cc: 69097-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Is the "(which see)" at the end intentional? On 14 September 2024 18:10:04 CEST, Sean Whitton wrote: >Hello, > >Installed=2E I fixed a couple of typos in your commit, and pushed anothe= r >commit doing some reformatting for readability=2E Hope you like it! > --=20 Sent from my phone=2E Please excuse my brevity and bad formatting=2E From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 17:23:12 2024 Received: (at 69097-done) by debbugs.gnu.org; 14 Sep 2024 21:23:12 +0000 Received: from localhost ([127.0.0.1]:47896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spaEa-0000II-0h for submit@debbugs.gnu.org; Sat, 14 Sep 2024 17:23:12 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:52794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spaEU-0000Hh-Jn for 69097-done@debbugs.gnu.org; Sat, 14 Sep 2024 17:23:10 -0400 DKIM-Signature: a=rsa-sha256; b=kjXeJXSL1vpOn1wS/oEsBz5y5wX/HefTjEKJZ/bFA30nIGB2mgyXx/G1PXR4qVUxuxdDxEm8zEvN/dmyiU3g25QTSI0SHrEKwrYxJjqdypdc0HlB8JkbZXL0iZilFgICFvQ9STwLe/0ekLog3cZhgXftloJvJGbcJiA5he5sxQcygbc+nXTiUmPZNz5UWU7puzJbrNVKqXdk/n3y4gCnfHUcvkOQdggLhdBB86m7IERxnmjx4LGRbUCR5yLJ60TImjGaTrz7C/danu1SrAUGCeiq5EqjGq/mt7a/6D83fePGIilGXk4x3VeJr/KI7aHrwtMikodTlKzkQmXCf9wpDQ==; s=purelymail2; d=spwhitton.name; v=1; bh=hq46bnWYIbmQMkUo1Ji950GPmS7ytKlWX9f0u/xP2I4=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=cN6Wo9t/m4QKe+++EmIn6j6BkwI4ZtK5Y1HqqStSkHyhYrrHwzDwXTNxWSjKQCIyyRlxThn0Tz4Oo8FNB97LFyiZCcaOc1nJvqNHfqRa/Ie/hqxZbhwaiJWk2ZxnFT1DJPxS6NEbAc55OP/J9s7UABsEgOk9T3LrpVrJTSBSx6VOrGXZMUc3HnhYIyly99BU7uohmhLSRrKUd8wZ04Th150/grYBHvn0/bUcoJQ7IiU1gKzaeoqJ5GTh7EaAy8yJ8Dpn8obQRvM4ud53EFk3GH+ektXDve+up6ZLVCRu7ydrN7gpg6t36x66Iziip98zg41YW/MHLi6P9WaawRMawQ==; s=purelymail2; d=purelymail.com; v=1; bh=hq46bnWYIbmQMkUo1Ji950GPmS7ytKlWX9f0u/xP2I4=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 69097-done@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1995282195; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 14 Sep 2024 21:22:49 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 2C83394993B; Sat, 14 Sep 2024 22:22:48 +0100 (BST) From: Sean Whitton To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: (Philip Kaludercic's message of "Sat, 14 Sep 2024 21:19:32 +0000") References: <871q9g8z8k.fsf@posteo.net> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <87jzfe8bdv.fsf@zephyr.silentflame.com> Date: Sat, 14 Sep 2024 22:22:48 +0100 Message-ID: <87v7yy6ic7.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69097-done Cc: 69097-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Sat 14 Sep 2024 at 09:19pm GMT, Philip Kaludercic wrote: > Is the "(which see)" at the end intentional? Yeah, not a typo. (It's actually all over the codebase.) -- Sean Whitton From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 14:00:31 2024 Received: (at 69097) by debbugs.gnu.org; 17 Sep 2024 18:00:31 +0000 Received: from localhost ([127.0.0.1]:55884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqcV3-0003Ey-LE for submit@debbugs.gnu.org; Tue, 17 Sep 2024 14:00:31 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqcUy-00036e-5C for 69097@debbugs.gnu.org; Tue, 17 Sep 2024 14:00:28 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id CFF2740004; Tue, 17 Sep 2024 17:59:40 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <87plp62uj1.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 14 Sep 2024 14:13:06 +0000") Organization: LINKOV.NET References: <871q9g8z8k.fsf@posteo.net> <87zfopep5q.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> Date: Tue, 17 Sep 2024 20:58:07 +0300 Message-ID: <86v7yuupqo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks for the new command! I'd like to use it, but currently can't because I have customized 'mark-even-if-inactive' to nil. > +** New user option 'kill-word-dwim'. > +This option, if non-nil, modifies the fall-back behavior of > +'kill-region' if no region is active, and will kill the last word > +instead of raising an error. Note that if you have disabled Transient > +Mark mode you might prefer to use 'unix-word-rubout', as this feature > +relies on there being an active region. This could mention the default keybindings of 'kill-region' ('C-w'). > +(defcustom kill-region-dwim nil > + "Behavior when `kill-region' is invoked without an active region. > +If set to nil (default), then the behavior `kill-region' will not > +change. If set to `emacs-word', then kill the last word as defined by > +the current major mode. If set to `unix-word', then kill the last word > +in the style of a shell like Bash, disregarding the major mode like with > +`unix-word-rubout'." > + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) > + (const :tag "Kill a word like Bash would" unix-word) > + (const :tag "Do not kill anything" nil)) Usually the default value 'nil' comes first. This helps to disable an option by always selecting 0 from the Customization menu. > (defun kill-region (beg end &optional region) > "Kill (\"cut\") text between point and mark. > This deletes the text from the buffer and saves it in the kill ring. > @@ -5843,21 +5856,35 @@ kill-region > (To delete text, use `delete-region'.) > Supply two arguments, character positions BEG and END indicating the > stretch of text to be killed. If the optional argument REGION is > - non-nil, the function ignores BEG and END, and kills the current > + `region', the function ignores BEG and END, and kills the current > region instead. Interactively, REGION is always non-nil, and so > - this command always kills the current region." > + this command always kills the current region. It is possible to > + override this behavior by customising the user option > + `kill-region-dwim'." I tried to use this command with `emacs -Q`, and typed 'C-w C-w' twice, but it fails with Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) kill-region(nil 16 emacs-word) funcall-interactively(kill-region nil 16 emacs-word) command-execute(kill-region) because for the second 'C-w' it calls 'kill-append': (if (eq last-command 'kill-region) (kill-append string (< end beg)) (kill-new string)) From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 12:09:42 2024 Received: (at 69097) by debbugs.gnu.org; 18 Sep 2024 16:09:42 +0000 Received: from localhost ([127.0.0.1]:59185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqxFO-0005Ft-4X for submit@debbugs.gnu.org; Wed, 18 Sep 2024 12:09:42 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:49675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqxFL-0005Fb-DD for 69097@debbugs.gnu.org; Wed, 18 Sep 2024 12:09:40 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 6DBA560002; Wed, 18 Sep 2024 16:09:14 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86v7yuupqo.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 17 Sep 2024 20:58:07 +0300") Organization: LINKOV.NET References: <871q9g8z8k.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <86v7yuupqo.fsf@mail.linkov.net> Date: Wed, 18 Sep 2024 19:08:35 +0300 Message-ID: <86plp1osfw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thanks for the new command! Sorry, I meant the new option. > I'd like to use it, but currently can't > because I have customized 'mark-even-if-inactive' to nil. This small fix addresses the remaining issues: diff --git a/lisp/simple.el b/lisp/simple.el index 9fbd9bfb577..40266f37209 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5865,7 +5865,7 @@ kill-region ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (progn - (let ((beg (mark)) + (let ((beg (mark kill-region-dwim)) (end (point))) (cond ((and kill-region-dwim (not (use-region-p))) @@ -5888,10 +5888,12 @@ kill-region ((filter-buffer-substring beg end 'delete))))) (when string ;STRING is nil if BEG = END ;; Add that string to the kill ring, one way or another. - (if (eq last-command 'kill-region) + (if (and (null kill-region-dwim) + (eq last-command 'kill-region)) (kill-append string (< end beg)) (kill-new string))) - (when (or string (eq last-command 'kill-region)) + (when (and (null kill-region-dwim) + (or string (eq last-command 'kill-region))) (setq this-command 'kill-region)) (setq deactivate-mark t) nil) From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 03:19:41 2024 Received: (at 69097) by debbugs.gnu.org; 19 Sep 2024 07:19:41 +0000 Received: from localhost ([127.0.0.1]:59689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srBS0-0003wn-Q7 for submit@debbugs.gnu.org; Thu, 19 Sep 2024 03:19:41 -0400 Received: from mout01.posteo.de ([185.67.36.65]:53655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srBRw-0003wP-GB for 69097@debbugs.gnu.org; Thu, 19 Sep 2024 03:19:39 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DF768240027 for <69097@debbugs.gnu.org>; Thu, 19 Sep 2024 09:19:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726730352; bh=r20/rt9q8YI0aNa5NsCgz+lbMC0/HDYjmu+wRdWduFU=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=OXEUkpOLO/ZreOg/XbMqDsjdeenQKj7HWIVni1qp3p+BWaGd8h2sSLKKNgLl8FjL+ f5kqhAbXVE+t4cjxjZSO/xat3MXIr1tyyIdXe1esd2zTvq9/U5p3HLjAGUQLrXEXzU 98AUHRX3Mbn37QnIePWwN6oDADx7xVzmayiNBl+gHQCVRN6FsXp8n6o1j3zIRj0nHH G6zL8u0mgU/tUMhUiq3GpO7pGkNTknXPQzCb5h/0bzT0OxqnFNl0rM9bEKIJKVJcuO 1PBGla98uDlChulVUjhd3CazSxzcdil06id5E1Tvc5XO/Wi0162PQ9knH7dbec3thi WwVzXZMMdgb+Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X8Rhv5DxJz6txT; Thu, 19 Sep 2024 09:19:11 +0200 (CEST) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86v7yuupqo.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 17 Sep 2024 20:58:07 +0300") References: <871q9g8z8k.fsf@posteo.net> <86r0a16i71.fsf@gnu.org> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <86v7yuupqo.fsf@mail.linkov.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Thu, 19 Sep 2024 07:19:11 +0000 Message-ID: <875xqsdsb4.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: > Thanks for the new command! I'd like to use it, but currently can't > because I have customized 'mark-even-if-inactive' to nil. > >> +** New user option 'kill-word-dwim'. >> +This option, if non-nil, modifies the fall-back behavior of >> +'kill-region' if no region is active, and will kill the last word >> +instead of raising an error. Note that if you have disabled Transient >> +Mark mode you might prefer to use 'unix-word-rubout', as this feature >> +relies on there being an active region. > > This could mention the default keybindings of 'kill-region' ('C-w'). > >> +(defcustom kill-region-dwim nil >> + "Behavior when `kill-region' is invoked without an active region. >> +If set to nil (default), then the behavior `kill-region' will not >> +change. If set to `emacs-word', then kill the last word as defined by >> +the current major mode. If set to `unix-word', then kill the last word >> +in the style of a shell like Bash, disregarding the major mode like with >> +`unix-word-rubout'." >> + :type '(choice (const :tag "Kill a word like `backward-kill-word'" emacs-word) >> + (const :tag "Kill a word like Bash would" unix-word) >> + (const :tag "Do not kill anything" nil)) > > Usually the default value 'nil' comes first. > This helps to disable an option by always selecting 0 > from the Customization menu. Good point, I had no real reason for listing it as the last option besides that the line length was shorter that way. >> (defun kill-region (beg end &optional region) >> "Kill (\"cut\") text between point and mark. >> This deletes the text from the buffer and saves it in the kill ring. >> @@ -5843,21 +5856,35 @@ kill-region >> (To delete text, use `delete-region'.) >> Supply two arguments, character positions BEG and END indicating the >> stretch of text to be killed. If the optional argument REGION is >> - non-nil, the function ignores BEG and END, and kills the current >> + `region', the function ignores BEG and END, and kills the current >> region instead. Interactively, REGION is always non-nil, and so >> - this command always kills the current region." >> + this command always kills the current region. It is possible to >> + override this behavior by customising the user option >> + `kill-region-dwim'." > > I tried to use this command with `emacs -Q`, and typed 'C-w C-w' twice, > but it fails with > > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) > kill-region(nil 16 emacs-word) > funcall-interactively(kill-region nil 16 emacs-word) > command-execute(kill-region) > > because for the second 'C-w' it calls 'kill-append': > > (if (eq last-command 'kill-region) > (kill-append string (< end beg)) > (kill-new string)) Juri Linkov writes: >> Thanks for the new command! > > Sorry, I meant the new option. > >> I'd like to use it, but currently can't >> because I have customized 'mark-even-if-inactive' to nil. > > This small fix addresses the remaining issues: > > diff --git a/lisp/simple.el b/lisp/simple.el > index 9fbd9bfb577..40266f37209 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -5865,7 +5865,7 @@ kill-region > ;; Pass mark first, then point, because the order matters when > ;; calling `kill-append'. > (interactive (progn > - (let ((beg (mark)) > + (let ((beg (mark kill-region-dwim)) > (end (point))) > (cond > ((and kill-region-dwim (not (use-region-p))) > @@ -5888,10 +5888,12 @@ kill-region > ((filter-buffer-substring beg end 'delete))))) > (when string ;STRING is nil if BEG = END > ;; Add that string to the kill ring, one way or another. > - (if (eq last-command 'kill-region) > + (if (and (null kill-region-dwim) > + (eq last-command 'kill-region)) > (kill-append string (< end beg)) > (kill-new string))) > - (when (or string (eq last-command 'kill-region)) > + (when (and (null kill-region-dwim) > + (or string (eq last-command 'kill-region))) > (setq this-command 'kill-region)) > (setq deactivate-mark t) > nil) Do you want to push this fix? I can take care of the other two points. -- Philip Kaludercic on siskin From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 02:53:25 2024 Received: (at 69097) by debbugs.gnu.org; 20 Sep 2024 06:53:25 +0000 Received: from localhost ([127.0.0.1]:33913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srXW9-0005mu-3c for submit@debbugs.gnu.org; Fri, 20 Sep 2024 02:53:25 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srXW6-0005mb-DQ for 69097@debbugs.gnu.org; Fri, 20 Sep 2024 02:53:23 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 52DC51BF208; Fri, 20 Sep 2024 06:52:53 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <875xqsdsb4.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 19 Sep 2024 07:19:11 +0000") Organization: LINKOV.NET References: <871q9g8z8k.fsf@posteo.net> <877cbshf4h.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <86v7yuupqo.fsf@mail.linkov.net> <875xqsdsb4.fsf@posteo.net> Date: Fri, 20 Sep 2024 09:50:20 +0300 Message-ID: <86ed5e7u6p.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Do you want to push this fix? I can take care of the other two points. Everything discussed so far is pushed now, so you can adjust if you want. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 12:57:33 2024 Received: (at 69097) by debbugs.gnu.org; 20 Sep 2024 16:57:33 +0000 Received: from localhost ([127.0.0.1]:36223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srgwn-0007A9-E7 for submit@debbugs.gnu.org; Fri, 20 Sep 2024 12:57:33 -0400 Received: from mout02.posteo.de ([185.67.36.66]:60639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srgwl-00079p-Ex for 69097@debbugs.gnu.org; Fri, 20 Sep 2024 12:57:32 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D4391240101 for <69097@debbugs.gnu.org>; Fri, 20 Sep 2024 18:57:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726851426; bh=OeFtASWC+g9zTdybjyu2RzCOMjSCdYJtBn0juUcMmUg=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=pJ0FmdhT+p0AU/otHKCNJkqOQEDQT3ZAyGwHgak8/T/5gxyQGTfm9OYJ4U3JRmtXy laqIOMzhg5JiCEfYxCMUi3I6u9riW0r5Lxc3h5BKajlre5ZRpy9/3uwMyOZ9/vD6AF oW/JIHWzO8pqU0cKM4Em3NehIybFIjp8tx0GQ6rtBvgqxUdJX9jYe8KPEtCQsEDPq7 pPptsdaGGU8FViBE0s1sZYAc0UxFTB9C8KmdUEDLVPFNu7mtubvSP9nSmbb8LyrwKS Dy05w9lC9tCywaTHnPj2Y2CtV6+K92oamPCoYOX/d4FYBhtbwgTPOg+EX5BA39e35x /8o5HSa17RHnw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X9JTG0SxNz9rxK; Fri, 20 Sep 2024 18:57:04 +0200 (CEST) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command In-Reply-To: <86ed5e7u6p.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 20 Sep 2024 09:50:20 +0300") References: <871q9g8z8k.fsf@posteo.net> <87a5gnzf5f.fsf@zephyr.silentflame.com> <87y146jv6z.fsf@posteo.net> <87ikvaxmbm.fsf@zephyr.silentflame.com> <871q1yw4fz.fsf@posteo.net> <877cbpvzkm.fsf@zephyr.silentflame.com> <86frqd10k1.fsf@gnu.org> <87r09wvqdp.fsf@zephyr.silentflame.com> <86frqbyemw.fsf@gnu.org> <871q1vuq7y.fsf@zephyr.silentflame.com> <87wmjntb7x.fsf@zephyr.silentflame.com> <87h6aosofr.fsf@zephyr.silentflame.com> <87bk0wmy17.fsf@posteo.net> <86plp6ha3y.fsf@gnu.org> <87r09m8ogh.fsf@zephyr.silentflame.com> <87ttei2w2o.fsf@posteo.net> <86seu2fi07.fsf@gnu.org> <87plp62uj1.fsf@posteo.net> <86v7yuupqo.fsf@mail.linkov.net> <875xqsdsb4.fsf@posteo.net> <86ed5e7u6p.fsf@mail.linkov.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt Date: Fri, 20 Sep 2024 16:57:03 +0000 Message-ID: <87y13mmffk.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69097 Cc: 69097@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Juri Linkov writes: >> Do you want to push this fix? I can take care of the other two points. > > Everything discussed so far is pushed now, so you can adjust if you want. No, it is fine. Thanks! -- Philip Kaludercic on siskin From unknown Fri Jun 20 07:16:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 19 Oct 2024 11:24:15 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator