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

From: Philip Kaludercic <[email-masked]>
Date: Fri, 03 May 2024 16:20:18 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Philip Kaludercic <[email-masked]>
>> Cc: [email-masked],  Richard Stallman <[email-masked]>
>> Date: Fri, 03 May 2024 10:48:13 +0000
>> 
>> Eli Zaretskii <[email-masked]> 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