[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#18727: 25.0.50; Paste to isearch-repeat-forward does not work
From: |
Juri Linkov |
Subject: |
bug#18727: 25.0.50; Paste to isearch-repeat-forward does not work |
Date: |
Mon, 05 Aug 2019 22:52:46 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>> 0. Run in a terminal: emacs -Q -nw
>> 1. C-s
>> 2.1. either from the MATE Terminal context menu select "Paste"
>> 2.2. or in xterm click the middle mouse button
>> (both calls the same command)
>> 3. Emacs hangs and typing 'C-g' produces the backtrace:
>
> Crystal ball says this is because of the xterm paste support. Can you
> try after disabling that extension?
I don't know how to disable it. Pasting works fine via ‘xterm-paste’ event and
command with the same name. But hangs when evaluating ‘(xterm--pasted-text)’.
Since the ‘xterm-paste’ command works without problems, I just copied its body
to ‘isearch-xterm-paste’, and everything works fine with this patch:
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 30f7fc7254..b7fd0b89ae 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2503,10 +2503,12 @@ isearch-mouse-2
(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.