Enable yanking non-Latin-1 primary selections in I-Search

* lisp/isearch.el (isearch-yank-x-selection): Call
`gui-get-primary-selection', which accounts for non-Latin-1
encodings.
This commit is contained in:
Po Lu 2025-03-14 15:52:59 +08:00
parent 5dc0981875
commit 1437fc2bca

View file

@ -2665,9 +2665,9 @@ always reads a string from the `kill-ring' using the minibuffer."
(isearch-yank-string (current-kill 1)))))
(defun isearch-yank-x-selection ()
"Pull current X selection into search string."
"Pull current X primary selection into search string."
(interactive)
(isearch-yank-string (gui-get-selection))
(isearch-yank-string (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)))