Fix a recent change in isearch.el

* lisp/isearch.el (isearch-yank-x-selection): Ignore errors
signaled by 'gui-get-primary-selection', to better emulate what
'gui-get-selection' was doing.  In particular,
'gui-get-primary-selection' can signal an error on MS-Windows.
This commit is contained in:
Eli Zaretskii 2025-03-14 14:00:16 +02:00
parent 0e93029353
commit 5d4056c765

View file

@ -2667,7 +2667,7 @@ always reads a string from the `kill-ring' using the minibuffer."
(defun isearch-yank-x-selection ()
"Pull current PRIMARY X selection into the search string."
(interactive)
(isearch-yank-string (gui-get-primary-selection))
(isearch-yank-string (ignore-errors (gui-get-primary-selection)))
;; If `gui-get-selection' returned the text from the active region,
;; then it "used" the mark which we should hence deactivate.
(when select-active-regions (deactivate-mark)))