Mercurial > emacs
comparison lisp/isearch.el @ 39047:d177c68813c0
(isearch-mouse-2): Renamed from isearch-mouse-yank.
Instead of running mouse-yank-at-click, see what the event is
bound to outside Isearch and run that.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 31 Aug 2001 08:51:39 +0000 |
parents | cdd382cc0e92 |
children | 45d6d104c4f2 |
comparison
equal
deleted
inserted
replaced
39046:a61b3d907098 | 39047:d177c68813c0 |
---|---|
315 ;; For searching multilingual text. | 315 ;; For searching multilingual text. |
316 (define-key map "\C-\\" 'isearch-toggle-input-method) | 316 (define-key map "\C-\\" 'isearch-toggle-input-method) |
317 (define-key map "\C-^" 'isearch-toggle-specified-input-method) | 317 (define-key map "\C-^" 'isearch-toggle-specified-input-method) |
318 | 318 |
319 ;; People expect to be able to paste with the mouse. | 319 ;; People expect to be able to paste with the mouse. |
320 (define-key map [mouse-2] #'isearch-mouse-yank) | 320 (define-key map [mouse-2] #'isearch-mouse-2) |
321 (define-key map [down-mouse-2] nil) | 321 (define-key map [down-mouse-2] nil) |
322 | 322 |
323 ;; Some bindings you may want to put in your isearch-mode-hook. | 323 ;; Some bindings you may want to put in your isearch-mode-hook. |
324 ;; Suggest some alternates... | 324 ;; Suggest some alternates... |
325 (define-key map "\M-c" 'isearch-toggle-case-fold) | 325 (define-key map "\M-c" 'isearch-toggle-case-fold) |
1044 (defun isearch-yank-x-selection () | 1044 (defun isearch-yank-x-selection () |
1045 "Pull current X selection into search string." | 1045 "Pull current X selection into search string." |
1046 (interactive) | 1046 (interactive) |
1047 (isearch-yank-string (x-get-selection))) | 1047 (isearch-yank-string (x-get-selection))) |
1048 | 1048 |
1049 (defun isearch-mouse-yank (click arg) | 1049 |
1050 "Yank with the mouse in Isearch mode. | 1050 (defun isearch-mouse-2 (click arg) |
1051 "Handle mouse-2 in Isearch mode. | |
1051 For a click in the echo area, invoke `isearch-yank-x-selection'. | 1052 For a click in the echo area, invoke `isearch-yank-x-selection'. |
1052 Otherwise invoke `mouse-yank-at-click'." | 1053 Otherwise invoke whatever mouse-2 is bound to outside of Isearch." |
1053 (interactive "e\nP") | 1054 (interactive "e\nP") |
1054 (let ((w (posn-window (event-start click)))) | 1055 (let* ((w (posn-window (event-start click))) |
1056 (overriding-terminal-local-map nil) | |
1057 (key (vector (event-basic-type click))) | |
1058 (binding (key-binding key))) | |
1055 (if (and (window-minibuffer-p w) | 1059 (if (and (window-minibuffer-p w) |
1056 (not (minibuffer-window-active-p w))) ; in echo area | 1060 (not (minibuffer-window-active-p w))) ; in echo area |
1057 (isearch-yank-x-selection) | 1061 (isearch-yank-x-selection) |
1058 (mouse-yank-at-click click arg)))) | 1062 (when binding |
1063 ;; Kluge to allow passing ARG to functions that support it, | |
1064 ;; like mouse-yank-at-click. | |
1065 (if (equal (cadr (interactive-form binding)) "e\nP") | |
1066 (funcall binding click arg) | |
1067 (funcall binding click)))))) | |
1068 | |
1059 | 1069 |
1060 (defun isearch-yank-word () | 1070 (defun isearch-yank-word () |
1061 "Pull next word from buffer into search string." | 1071 "Pull next word from buffer into search string." |
1062 (interactive) | 1072 (interactive) |
1063 (isearch-yank-string | 1073 (isearch-yank-string |