GNU bug report logs -
#69097
[PATCH] Add 'kill-region-or-word' command
Previous Next
Reported by: Philip Kaludercic <philipk <at> posteo.net>
Date: Tue, 13 Feb 2024 09:57:02 UTC
Severity: normal
Tags: patch
Done: Sean Whitton <spwhitton <at> spwhitton.name>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Sean Whitton <spwhitton <at> spwhitton.name> 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:
[0001-Allow-kill-region-kill-the-last-word-when-there-is-n.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
--
Philip Kaludercic on siskin
This bug report was last modified 243 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.