diff options
| author | Juri Linkov | 2019-12-16 02:18:00 +0200 |
|---|---|---|
| committer | Juri Linkov | 2019-12-16 02:18:00 +0200 |
| commit | 5aab1e83f55ccbf7affc25272f6b1107aa17598c (patch) | |
| tree | a137ba6135b875f7cab16435cb3f8676adecc671 | |
| parent | 7254b6346229a7b71b69f71e2d8eee113f02585a (diff) | |
| download | emacs-5aab1e83f55ccbf7affc25272f6b1107aa17598c.tar.gz emacs-5aab1e83f55ccbf7affc25272f6b1107aa17598c.zip | |
* lisp/isearch.el (isearch-xterm-paste): Use code like in 'xterm-paste'.
Add arg 'event' and use it to get pasted text.
This allows pasting text on terminals to the
search string (bug#18727, bug#36950).
| -rw-r--r-- | lisp/isearch.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 4f3342782d3..2928a96b97d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -2508,10 +2508,12 @@ is bound to outside of Isearch." | |||
| 2508 | 2508 | ||
| 2509 | (declare-function xterm--pasted-text "term/xterm" ()) | 2509 | (declare-function xterm--pasted-text "term/xterm" ()) |
| 2510 | 2510 | ||
| 2511 | (defun isearch-xterm-paste () | 2511 | (defun isearch-xterm-paste (event) |
| 2512 | "Pull terminal paste into search string." | 2512 | "Pull terminal paste into search string." |
| 2513 | (interactive) | 2513 | (interactive "e") |
| 2514 | (isearch-yank-string (xterm--pasted-text))) | 2514 | (when (eq (car-safe event) 'xterm-paste) |
| 2515 | (let ((pasted-text (nth 1 event))) | ||
| 2516 | (isearch-yank-string pasted-text)))) | ||
| 2515 | 2517 | ||
| 2516 | (defun isearch-yank-internal (jumpform) | 2518 | (defun isearch-yank-internal (jumpform) |
| 2517 | "Pull the text from point to the point reached by JUMPFORM. | 2519 | "Pull the text from point to the point reached by JUMPFORM. |