all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18727@debbugs.gnu.org, berts@amazon.com, larsi@gnus.org
Subject: bug#18727: 25.0.50; Paste to isearch-repeat-forward does not work
Date: Mon, 05 Aug 2019 22:52:46 +0300	[thread overview]
Message-ID: <87tvavxwy9.fsf@mail.linkov.net> (raw)
In-Reply-To: <83lfw7d2fr.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 05 Aug 2019 19:03:52 +0300")

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: isearch-xterm-paste.patch --]
[-- Type: text/x-diff, Size: 657 bytes --]

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.

  reply	other threads:[~2019-08-05 19:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 22:39 bug#18727: 25.0.50; Paste to isearch-repeat-forward does not work Bert Sutherland
2019-08-03 16:59 ` Lars Ingebrigtsen
2019-08-04 19:20   ` Juri Linkov
2019-08-05  9:32     ` Lars Ingebrigtsen
2019-08-05 19:54       ` Juri Linkov
2019-08-05 16:03     ` Eli Zaretskii
2019-08-05 19:52       ` Juri Linkov [this message]
2019-08-06  2:31         ` Eli Zaretskii
2019-08-06 22:19           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvavxwy9.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=18727@debbugs.gnu.org \
    --cc=berts@amazon.com \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.