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 20:47:10 -0600 Message-ID: <8760gjqcwh.fsf@gmail.com> References: <87a8m13gba.fsf@zira.vinc17.org> <871sr7h1xy.fsf@gmail.com> <87inkj43q9.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1496112495 26266 195.159.176.226 (30 May 2017 02:48:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 May 2017 02:48:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Vincent Lefevre , 23007@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 30 04:48:08 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 1dFXCY-0006Vz-Ua for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 May 2017 04:48:07 +0200 Original-Received: from localhost ([::1]:51217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFXCe-0000x8-7I for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 May 2017 22:48:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFXCY-0000w5-0q for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 22:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFXCU-0002aa-RJ for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 22:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFXCU-0002aW-Nw for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 22:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dFXCU-0002G8-B7 for bug-gnu-emacs@gnu.org; Mon, 29 May 2017 22:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 May 2017 02:48:02 +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: patch Original-Received: via spool by 23007-submit@debbugs.gnu.org id=B23007.14961124448639 (code B ref 23007); Tue, 30 May 2017 02:48:02 +0000 Original-Received: (at 23007) by debbugs.gnu.org; 30 May 2017 02:47:24 +0000 Original-Received: from localhost ([127.0.0.1]:44012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFXBs-0002FH-Ae for submit@debbugs.gnu.org; Mon, 29 May 2017 22:47:24 -0400 Original-Received: from mail-it0-f66.google.com ([209.85.214.66]:34127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFXBr-0002F4-AJ for 23007@debbugs.gnu.org; Mon, 29 May 2017 22:47:23 -0400 Original-Received: by mail-it0-f66.google.com with SMTP id d68so8486156ita.1 for <23007@debbugs.gnu.org>; Mon, 29 May 2017 19:47:23 -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=NggvBQ12YDS0nze1ruHv1/fZPBBO2u/4hA05zxOOlXo=; b=TPmRsNVRPvl/MqWnvQBrQ0rd9UsKE+UPULwWdGOqgD99vPtw3NnilhjGDlFo3LeCDh MTXpGEqvCZklwIV+i3HK6xd1c1DQTtAUsIlWfffKGRAZ03OepQCdHT+G3Buuv3yXTyJ6 de0Glbt/k2l6OVn1kU4Ky8QS6s8WB8MXBA6Laeo+CAAdPVC4rut8Xa5b8xOZFjJEiLq6 CA0YHp/UAsNcPD7Wr85PD7CD/JFEXZcOXZSQzsKe6OWJNEHx9unr3cAEUv3idjey4o2W fAM8SHPtZWFyW5TlD63Y2Wa+U2zxPDJjJGb5uZZrW166+Ty0KVcubGI+SFKOblk53nwJ 4g7A== 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=NggvBQ12YDS0nze1ruHv1/fZPBBO2u/4hA05zxOOlXo=; b=IhmBe3aBThdxvM4xETfzYT6DWFcPdvxqij1wWHGufqbSGI3ro8aWzw40lOnXw7Fw4G D1AAkI5MbqmUa1UB1E1LcC6ULfpN7NGOrRp1F5ZL6TtB2p28Rz6IKIGCsSBnpqb4TvrA RM+I5nu/1AoDIG8dQlBEct3L6h8urlr0xdKeViGAzL7gpSVlM7Aezm58nQEJrbQXOKzn i+S/l0hzCmkaI5gHZBqb2Z4UqxTw4F9FVv0C2nOeUBpsKgFttoxJPNinm9g7Uq3Ec6zz 1+deu3gm/W36Vq81u1qKNk7YyxokoJ6sDULGuZ/2FfxG+FRntq91O3fcNqyCVAbLzHnb Yd9w== X-Gm-Message-State: AODbwcAMN6T5cIBFDdCG2N4//igwqZXBMZGPz2su2jiDmTogGBp5t7g1 BFxznpPAzh3niA== X-Received: by 10.36.91.212 with SMTP id g203mr57076itb.94.1496112437507; Mon, 29 May 2017 19:47:17 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id n42sm5017090ioi.4.2017.05.29.19.47.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 May 2017 19:47:16 -0700 (PDT) In-Reply-To: <87inkj43q9.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Mon, 29 May 2017 19:56:14 -0400") 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:133033 Archived-At: --=-=-= Content-Type: text/plain npostavs@users.sourceforge.net writes: > Alex writes: > >> + (let ((overriding-terminal-local-map nil)) >> + (setq binding (key-binding (this-command-keys-vector) t))) > > IMO, it would be better style to do something like > > (let ((binding (let ((overriding-terminal-local-map nil)) > (key-binding (this-command-keys-vector) t)))) > ...) That was my first idea, but at the time I thought it was better style to use the setq version instead. :) Your version makes the binding more obvious, though, so I updated the patch to use it. I've attached it below. PS: I don't immediately see a reason to check for the (mark) in the condition. I tested by deactivating the mark explicitly, and setting mark-even-if-inactive to nil in the window, but it still worked correctly. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Limit-scope-of-local-overriding-terminal-local-map.patch Content-Description: patch v2 >From be6236ea77920a123a30b6fb3b4d52602d4d9097 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index c34739d638..0d50c9dd9a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2036,14 +2036,14 @@ 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 (let ((overriding-terminal-local-map nil)) + (key-binding (this-command-keys-vector) t)))) (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) (when (functionp binding) - (call-interactively binding))))) + (call-interactively binding))))) (declare-function xterm--pasted-text "term/xterm" ()) -- 2.11.0 --=-=-=--