all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: npostavs@users.sourceforge.net
Cc: Vincent Lefevre <vincent@vinc17.net>, 23007@debbugs.gnu.org
Subject: bug#23007: 24.5; buggy interactive search with middle click
Date: Mon, 29 May 2017 20:47:10 -0600	[thread overview]
Message-ID: <8760gjqcwh.fsf@gmail.com> (raw)
In-Reply-To: <87inkj43q9.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Mon, 29 May 2017 19:56:14 -0400")

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

npostavs@users.sourceforge.net writes:

> Alex <agrambot@gmail.com> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch v2 --]
[-- Type: text/x-diff, Size: 1551 bytes --]

From be6236ea77920a123a30b6fb3b4d52602d4d9097 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
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


  parent reply	other threads:[~2017-05-30  2:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14  3:10 bug#23007: 24.5; buggy interactive search with middle click Vincent Lefevre
2017-05-29 19:56 ` Alex
2017-05-29 23:56   ` npostavs
2017-05-30  0:41     ` Drew Adams
2017-05-30  0:53       ` npostavs
2017-05-30  1:07         ` Drew Adams
2017-05-30  1:28           ` npostavs
2017-05-30  2:04             ` Drew Adams
2017-05-30  2:47     ` Alex [this message]
2017-05-30  4:44       ` Drew Adams
2017-05-30 11:47       ` npostavs
2017-06-01 22:09         ` npostavs

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=8760gjqcwh.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=23007@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=vincent@vinc17.net \
    /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.