bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-09 Thread Sean Whitton
Hello, On Mon 09 Sep 2024 at 10:03pm +03, Eli Zaretskii wrote: >> From: Sean Whitton >> Cc: phil...@posteo.net, stefankan...@gmail.com, acora...@gnu.org, >> j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org >> Date: Mon, 09 Sep 2024 18:54:16 +0100 >> >> Hello Eli, >> >> Any comments on

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-09 Thread Philip Kaludercic
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: >From 0f19dadb75a01873cb3f40a6addd82

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-09 Thread Eli Zaretskii
> From: Sean Whitton > Cc: phil...@posteo.net, stefankan...@gmail.com, acora...@gnu.org, > j...@linkov.net, r...@gnu.org, 69...@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,

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-09 Thread Sean Whitton
Hello Eli, Any comments on v4? I'd like to commit to unblock Philip. Thanks! -- Sean Whitton

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-08 Thread Philip Kaludercic
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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-07 Thread Sean Whitton
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 fi

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-07 Thread Sean Whitton
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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-07 Thread Philip Kaludercic
Eli Zaretskii writes: >> From: Sean Whitton >> Cc: phil...@posteo.net, stefankan...@gmail.com, acora...@gnu.org, >> j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org >> Date: Fri, 06 Sep 2024 14:54:58 +0100 >> >> +(defun forward-unix-word (arg &optional delim) >> + "Move forward ARG u

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-07 Thread Eli Zaretskii
> From: Sean Whitton > Cc: phil...@posteo.net, stefankan...@gmail.com, acora...@gnu.org, > j...@linkov.net, r...@gnu.org, 69...@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 wh

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-06 Thread Philip Kaludercic
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. >

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-06 Thread Sean Whitton
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. > Sho

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-06 Thread Sean Whitton
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. >

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-06 Thread Sean Whitton
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, b

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-06 Thread Eli Zaretskii
> From: Sean Whitton > Cc: Eli Zaretskii , stefankan...@gmail.com, > acora...@gnu.org, j...@linkov.net, r...@gnu.org, 69...@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 tak

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Philip Kaludercic
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 "[

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Sean Whitton
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:]") >>> +

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Philip Kaludercic
Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: spwhit...@spwhitton.name, stefankan...@gmail.com, acora...@gnu.org, >> j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org >> Date: Thu, 05 Sep 2024 10:02:45 + >> >> Eli Zaretskii writes: >> >> > If we don't introduce a new co

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Eli Zaretskii
> From: Philip Kaludercic > Cc: spwhit...@spwhitton.name, stefankan...@gmail.com, acora...@gnu.org, > j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org > Date: Thu, 05 Sep 2024 10:02:45 + > > Eli Zaretskii writes: > > > If we don't introduce a new command, then what will be the mod

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Philip Kaludercic
Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , stefankan...@gmail.com, >> acora...@gnu.org, j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org >> Date: Thu, 05 Sep 2024 09:39:32 + >> >> >> I think I'm missing something here. When it's nil and there is no >>

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Eli Zaretskii
> From: Philip Kaludercic > Cc: Eli Zaretskii , stefankan...@gmail.com, > acora...@gnu.org, j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org > Date: Thu, 05 Sep 2024 09:39:32 + > > >> I think I'm missing something here. When it's nil and there is no > >> *active* region, but there

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-05 Thread Philip Kaludercic
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 `

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-04 Thread Eli Zaretskii
> From: Sean Whitton > Cc: Eli Zaretskii , stefankan...@gmail.com, > acora...@gnu.org, j...@linkov.net, r...@gnu.org, 69...@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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-04 Thread Sean Whitton
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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-04 Thread Eli Zaretskii
> From: Philip Kaludercic > Cc: spwhit...@spwhitton.name, stefankan...@gmail.com, acora...@gnu.org, > j...@linkov.net, r...@gnu.org, 69...@debbugs.gnu.org > Date: Tue, 03 Sep 2024 16:32:46 + > > I've added the NEWS entry from the last iteration of the patch (now > actually as a patch, n

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Robert Pluim
> On Tue, 03 Sep 2024 16:32:46 +, Philip Kaludercic > said: >> >> 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 the poi

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Philip Kaludercic
Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , Stefan Kangas , >> Andrea Corallo , j...@linkov.net, r...@gnu.org, >> 69...@debbugs.gnu.org >> Date: Mon, 02 Sep 2024 21:12:01 + >> >> I had misremembered the last state of this patch. It is easier to just >> ha

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Eli Zaretskii
> From: Robert Pluim > Cc: phil...@posteo.net, r...@gnu.org, 69...@debbugs.gnu.org, > j...@linkov.net, stefankan...@gmail.com, acora...@gnu.org, > spwhit...@spwhitton.name > Date: Tue, 03 Sep 2024 16:55:29 +0200 > > +(defcustom kill-word-if-no-region nil > + "Behaviour when `kill-region'

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Robert Pluim
> On Tue, 03 Sep 2024 17:27:59 +0300, Eli Zaretskii said: >> >> + "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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Eli Zaretskii
> From: Robert Pluim > Cc: Philip Kaludercic , r...@gnu.org, > 69...@debbugs.gnu.org, j...@linkov.net, stefankan...@gmail.com, > acora...@gnu.org, spwhit...@spwhitton.name > Date: Tue, 03 Sep 2024 15:53:39 +0200 > > > On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: > > >

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Robert Pluim
> On Tue, 03 Sep 2024 15:21:54 +0300, Eli Zaretskii said: >> From: Philip Kaludercic >> Cc: Eli Zaretskii , Stefan Kangas , >> Andrea Corallo , j...@linkov.net, r...@gnu.org, >> 69...@debbugs.gnu.org >> Date: Mon, 02 Sep 2024 21:12:01 + >> >> I had misrem

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-03 Thread Eli Zaretskii
> From: Philip Kaludercic > Cc: Eli Zaretskii , Stefan Kangas , > Andrea Corallo , j...@linkov.net, r...@gnu.org, > 69...@debbugs.gnu.org > Date: Mon, 02 Sep 2024 21:12:01 + > > I had misremembered the last state of this patch. It is easier to just > have a tristate option. Here is t

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Philip Kaludercic
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 eith

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Sean Whitton
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'

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Philip Kaludercic
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 >

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Sean Whitton
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,

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Philip Kaludercic
Stefan Kangas writes: > Eli Zaretskii writes: > >>> From: Philip Kaludercic >>> Cc: Sean Whitton , j...@linkov.net, >>> r...@gnu.org, >>> 69...@debbugs.gnu.org >>> Date: Sun, 01 Sep 2024 20:06:00 + >>> >>> Ping. I am not sure how to proceed on this patch. IIRC the issue was >>> tha

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Sean Whitton
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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Stefan Kangas
Eli Zaretskii writes: >> From: Philip Kaludercic >> Cc: Sean Whitton , j...@linkov.net, r...@gnu.org, >> 69...@debbugs.gnu.org >> Date: Sun, 01 Sep 2024 20:06:00 + >> >> Ping. I am not sure how to proceed on this patch. IIRC the issue was >> that the notion of a word differs in Emacs a

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-02 Thread Eli Zaretskii
> From: Philip Kaludercic > Cc: Sean Whitton , j...@linkov.net, r...@gnu.org, > 69...@debbugs.gnu.org > Date: Sun, 01 Sep 2024 20:06:00 + > > 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 Wh

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-01 Thread Sean Whitton
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

bug#69097: [PATCH] Add 'kill-region-or-word' command

2024-09-01 Thread Philip Kaludercic
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 Linu