aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2025-03-14 15:52:59 +0800
committerPo Lu2025-03-14 15:54:01 +0800
commit1437fc2bca2e42cd2a28754bbb4d9ac1403b87b7 (patch)
tree6a94aa6ba20311e7ea4de8218065dc4c56523ce8
parent5dc0981875b64f2ffe38e59871cc34db05ab5f18 (diff)
downloademacs-1437fc2bca2e42cd2a28754bbb4d9ac1403b87b7.tar.gz
emacs-1437fc2bca2e42cd2a28754bbb4d9ac1403b87b7.zip
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.
-rw-r--r--lisp/isearch.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index e31c5f7e59a..636571e11c7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2665,9 +2665,9 @@ always reads a string from the `kill-ring' using the minibuffer."
2665 (isearch-yank-string (current-kill 1))))) 2665 (isearch-yank-string (current-kill 1)))))
2666 2666
2667(defun isearch-yank-x-selection () 2667(defun isearch-yank-x-selection ()
2668 "Pull current X selection into search string." 2668 "Pull current X primary selection into search string."
2669 (interactive) 2669 (interactive)
2670 (isearch-yank-string (gui-get-selection)) 2670 (isearch-yank-string (gui-get-primary-selection))
2671 ;; If `gui-get-selection' returned the text from the active region, 2671 ;; If `gui-get-selection' returned the text from the active region,
2672 ;; then it "used" the mark which we should hence deactivate. 2672 ;; then it "used" the mark which we should hence deactivate.
2673 (when select-active-regions (deactivate-mark))) 2673 (when select-active-regions (deactivate-mark)))