Subject: RE: [External] : bug#73723: 31.0.50; Add copy/kill/mark commands to isearch

From: Drew Adams <[email-masked]>
Date: Thu, 10 Oct 2024 22:04:41 +0000

>   (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)))

Two minor suggestions:

. Neither buffer-substring nor kill-region needs the
  positions in any particular order - don't need min/max.
  E.g., just (kill-region (point) isearch-other-end) 

. Show a message at the end of `isearch-copy-match':
  (let ((message-log-max  nil))
    (message "Copied search match as kill"))
  (sit-for 1)
  (isearch-update)