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