diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-05-22 13:38:53 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-05-22 13:39:30 -0700 |
commit | 869092c9ed373e97f92c7f7518396e3fbdb24dd8 (patch) | |
tree | ec04c978bdb685b671184daf30ac3a166050ebe5 /lisp/isearch.el | |
parent | 5ab083034ca221a7b4f00156a0efece84da999d8 (diff) | |
download | emacs-869092c9ed373e97f92c7f7518396e3fbdb24dd8.tar.gz |
Bring back xterm pasting with middle mouse
Problem reported by Jan Synáček.
Solution suggested by Stefan Monnier (Bug#23519).
* lisp/isearch.el (isearch-mode-map): Add a binding for xterm-paste.
(xterm--pasted-text): New decl.
(isearch-xterm-paste): New function.
* lisp/term/xterm.el (xterm--pasted-text): New function,
taken from xterm-paste internals.
(xterm-paste): Use it.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r-- | lisp/isearch.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index e4de0b627e3..7360a0b3742 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -510,6 +510,7 @@ This is like `describe-bindings', but displays only Isearch keys." ;; People expect to be able to paste with the mouse. (define-key map [mouse-2] #'isearch-mouse-2) (define-key map [down-mouse-2] nil) + (define-key map [xterm-paste] #'isearch-xterm-paste) ;; Some bindings you may want to put in your isearch-mode-hook. ;; Suggest some alternates... @@ -2001,6 +2002,13 @@ is bound to outside of Isearch." (when (functionp binding) (call-interactively binding))))) +(declare-function xterm--pasted-text "term/xterm" ()) + +(defun isearch-xterm-paste () + "Pull terminal paste into search string." + (interactive) + (isearch-yank-string (xterm--pasted-text))) + (defun isearch-yank-internal (jumpform) "Pull the text from point to the point reached by JUMPFORM. JUMPFORM is a lambda expression that takes no arguments and returns |