Subject: Re: bug#73723: 31.0.50; Add copy/kill/mark commands to isearch

From: Eli Zaretskii <[email-masked]>
Date: Thu, 10 Oct 2024 07:48:10 +0300

> Date: Thu, 10 Oct 2024 09:33:41 +1300
> From: Phil Sainty <[email-masked]>
> 
> I find the following useful, and sometimes see others asking for
> the same thing.  Shall we add these to Emacs?
> 
>   (defun isearch-copy-match ()
>     "Copy the currently-matched text to the kill ring."
>     (interactive)
>     (kill-new (buffer-substring (min (point) isearch-other-end)
>                                 (max (point) isearch-other-end))))
> 
>   (defun isearch-kill-match ()
>     "Kill the currently-matched text."
>     (interactive)
>     (kill-region (min (point) isearch-other-end)
>                  (max (point) isearch-other-end)))
> 
>   (defun isearch-mark-match ()
>     "Exit isearch, marking the last match."
>     (interactive)
>     (set-mark isearch-other-end)
>     (isearch-exit)
>     (activate-mark))
> 
>   (define-key isearch-mode-map (kbd "M-s M-w") #'isearch-copy-match)
>   (define-key isearch-mode-map (kbd "M-s C-w") #'isearch-kill-match)
>   (define-key isearch-mode-map (kbd "M-s C-SPC") #'isearch-mark-match)
>   (define-key isearch-mode-map (kbd "M-s C-@") #'isearch-mark-match)

Sounds useful, but "M-x M-w" is already taken, unfortunately.

For isearch-kill-match, should there also be a command to kill _all_
the matches?

Thanks.