]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/isearch.el (isearch-xterm-paste): Use code like in 'xterm-paste'.
authorJuri Linkov <juri@linkov.net>
Mon, 16 Dec 2019 00:18:00 +0000 (02:18 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 16 Dec 2019 00:18:00 +0000 (02:18 +0200)
Add arg 'event' and use it to get pasted text.
This allows pasting text on terminals to the
search string (bug#18727, bug#36950).

lisp/isearch.el

index 4f3342782d38e6b5aa2f5089cef844df28116211..2928a96b97df197f679dc0a2be51804d7ebb8c26 100644 (file)
@@ -2508,10 +2508,12 @@ is bound to outside of Isearch."
 
 (declare-function xterm--pasted-text "term/xterm" ())
 
-(defun isearch-xterm-paste ()
+(defun isearch-xterm-paste (event)
   "Pull terminal paste into search string."
-  (interactive)
-  (isearch-yank-string (xterm--pasted-text)))
+  (interactive "e")
+  (when (eq (car-safe event) 'xterm-paste)
+    (let ((pasted-text (nth 1 event)))
+      (isearch-yank-string pasted-text))))
 
 (defun isearch-yank-internal (jumpform)
   "Pull the text from point to the point reached by JUMPFORM.