From 5aab1e83f55ccbf7affc25272f6b1107aa17598c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 16 Dec 2019 02:18:00 +0200 Subject: [PATCH] * lisp/isearch.el (isearch-xterm-paste): Use code like in 'xterm-paste'. 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 4f3342782d3..2928a96b97d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -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. -- 2.39.2