From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#23007: 24.5; buggy interactive search with middle click Date: Mon, 29 May 2017 13:56:25 -0600 Message-ID: <871sr7h1xy.fsf@gmail.com> References: <87a8m13gba.fsf@zira.vinc17.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1496087837 9009 195.159.176.226 (29 May 2017 19:57:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 May 2017 19:57:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 23007@debbugs.gnu.org To: Vincent Lefevre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 29 21:57:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFQmt-000260-Fg for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 May 2017 21:57:11 +0200 Original-Received: from localhost ([::1]:50330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFQmx-000694-4m for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 May 2017 15:57:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFQmp-00067H-7f for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 15:57:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFQmk-0007og-6x for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 15:57:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFQmk-0007oc-3A for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 15:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dFQmj-0004KD-Mo for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 15:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 May 2017 19:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23007-submit@debbugs.gnu.org id=B23007.149608781016608 (code B ref 23007); Mon, 29 May 2017 19:57:01 +0000 Original-Received: (at 23007) by debbugs.gnu.org; 29 May 2017 19:56:50 +0000 Original-Received: from localhost ([127.0.0.1]:43800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFQmY-0004Jj-AH for submit@debbugs.gnu.org; Mon, 29 May 2017 15:56:50 -0400 Original-Received: from mail-io0-f195.google.com ([209.85.223.195]:33272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFQmV-0004JP-Ia; Mon, 29 May 2017 15:56:48 -0400 Original-Received: by mail-io0-f195.google.com with SMTP id m4so7562690ioe.0; Mon, 29 May 2017 12:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=iP6t4zDffcrtnr9tUr7bt5AGe529Wc6qmspFQojCgNA=; b=VnnNIkLJ/2Odjc//GuoYCHGlGh2xo7e/ga+D8YF3KMZWiN+2or4STqwDlLczW5T+Lg 9Z+XReIBrOCNf+SkwQ/WXZ1BxeoDUZM58dYIX6ThjvplG8oWKzXXmdkzK8JpjLK3Hel3 5f+WhyTJDyfCyK+hVerj/u6XeaXSlXLc+lSIvaidlgGtY+1zcWjzH/ixNcjMUJF6Hepf fkH2z7VfX2Dv2398lz+91bl2EUzP+G6qq7FvGpSIA0fio7QRRcQu4JHDNppBUacypuft xWCmJsgJjvALQPhmPVxUE218P1lI3oOcbUPwO2nDgDSM5dAEtSY1QZ6v3uNAx9tiZFX+ 1egw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=iP6t4zDffcrtnr9tUr7bt5AGe529Wc6qmspFQojCgNA=; b=XGwjguTpDa+PXihNNEHyt7uJa6ISI/T+dh2ZQAPCqqqEo2Rz14f3xo0XXS5rl82v7B cqYdkWe9aSjbcOSwntRB55zmQviHZhHPL0F0CWZrSd6VTwzL8QscfF1rj0ahXAmtG0Ej tZ/K94H7joYBgfWNrG/BG8EXBJcPSzy/JwKhtczJ+am7wsvCZ3UW5cvCG58Wb+mj1M/n QoPqSYt8vXqgSIBcz1J1EA2xyoSHdjqA3a5L8WpQ1uPZ58rc7fhRAxz05DnjgZY+QyxY NH6QcO+kb3kSmKZMkOVxxVJTy6c9HYOHdeskz2pvNHgzInw2vw5nLVIHIyqKCS68as1N VsGA== X-Gm-Message-State: AODbwcCw+2ziURoo9zEKOpwbo19yiQpxNVkoD71y7WEflnmqx7SOvcv6 B1wC3pcg1PlLuwE8 X-Received: by 10.107.57.198 with SMTP id g189mr14141345ioa.123.1496087801292; Mon, 29 May 2017 12:56:41 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id v125sm8589479ita.13.2017.05.29.12.56.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 May 2017 12:56:40 -0700 (PDT) In-Reply-To: <87a8m13gba.fsf@zira.vinc17.org> (Vincent Lefevre's message of "Mon, 14 Mar 2016 04:10:33 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133006 Archived-At: --=-=-= Content-Type: text/plain tags 23007 patch quit Vincent Lefevre writes: > 1. Start Emacs with its own UI under X Window. > > 2. Type: M-< > Here the cursor is at the beginning of the buffer, which contains > some text. > > 3. In some other window, select some text (e.g. the letter "n"). > > 4. Type: C-s > This starts the interactive search. It says: > I-search: > > 5. Click with the middle button near the bottom of the window. > This pastes the text at the end of the buffer. > > 6. Type: C-_ > This removes the pasted text and moves the cursor back at the > beginning of the buffer. > > 7. Type: C-s > This starts the interactive search again. But this time, it says: > I-search: [No previous search string] > > 8. Type: e > This searches for "e". All the occurrences of "e" are highlighted. > > 9. Type: > This is no longer the interactive search, but the occurrences of "e" > are still highlighted. > > Typing other letters brings back to the interactive search. This is because clicking the middle button during isearch calls isearch-mouse-2, which calls the usual mouse-yank-primary, which calls isearch-done to finish isearch. Problem is, it let-binds overriding-terminal-local-map around this call, which counteracts isearch-done setting this variable to nil. The end result is having quit isearch, but with the overriding map still in place. I have attached a simple patch below. Eli, if it's satisfactory, would you commit it for me? TIA --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Limit-scope-of-local-overriding-terminal-local-map.patch Content-Description: patch >From 33251d03d1d2298b29ae2a35ecccb8ae41e8bdd4 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Mon, 29 May 2017 13:43:23 -0600 Subject: [PATCH] Limit scope of local overriding-terminal-local-map The function `binding' may call isearch-done, which globally sets overriding-terminal-local-map to nil (Bug #23007). * lisp/isearch.el (isearch-mouse-2): Don't bind overriding-terminal-local-map around the call to `binding'. --- lisp/isearch.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index c34739d638..992794e43a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2036,14 +2036,15 @@ isearch-mouse-2 Otherwise invoke whatever the calling mouse-2 command sequence is bound to outside of Isearch." (interactive "e") - (let* ((w (posn-window (event-start click))) - (overriding-terminal-local-map nil) - (binding (key-binding (this-command-keys-vector) t))) + (let ((w (posn-window (event-start click))) + binding) (if (and (window-minibuffer-p w) - (not (minibuffer-window-active-p w))) ; in echo area - (isearch-yank-x-selection) + (not (minibuffer-window-active-p w))) ; in echo area + (isearch-yank-x-selection) + (let ((overriding-terminal-local-map nil)) + (setq binding (key-binding (this-command-keys-vector) t))) (when (functionp binding) - (call-interactively binding))))) + (call-interactively binding))))) (declare-function xterm--pasted-text "term/xterm" ()) -- 2.11.0 --=-=-=--