Mercurial > emacs
comparison lisp/isearch.el @ 3957:4d53420e2df4
(isearch-other-meta-char): Handle sequences
containing mouse clicks in scroll-bar that used another buffer's map.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 02 Jul 1993 21:34:15 +0000 |
parents | 620f551ac276 |
children | b145227c647a |
comparison
equal
deleted
inserted
replaced
3956:ef9f2cfb6703 | 3957:4d53420e2df4 |
---|---|
2 | 2 |
3 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> | 5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> |
6 | 6 |
7 ;; |$Date: 1993/06/09 11:53:58 $|$Revision: 1.42 $ | 7 ;; |$Date: 1993/06/13 21:43:15 $|$Revision: 1.43 $ |
8 | 8 |
9 ;; This file is not yet part of GNU Emacs, but it is based almost | 9 ;; This file is not yet part of GNU Emacs, but it is based almost |
10 ;; entirely on isearch.el which is part of GNU Emacs. | 10 ;; entirely on isearch.el which is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is distributed in the hope that it will be useful, | 12 ;; GNU Emacs is distributed in the hope that it will be useful, |
1006 (let ((key (this-command-keys))) | 1006 (let ((key (this-command-keys))) |
1007 (apply 'isearch-unread (listify-key-sequence key))) | 1007 (apply 'isearch-unread (listify-key-sequence key))) |
1008 (isearch-edit-string)) | 1008 (isearch-edit-string)) |
1009 (search-exit-option | 1009 (search-exit-option |
1010 (let ((key (this-command-keys)) | 1010 (let ((key (this-command-keys)) |
1011 (index 0) | |
1011 window) | 1012 window) |
1012 (apply 'isearch-unread (listify-key-sequence key)) | 1013 (apply 'isearch-unread (listify-key-sequence key)) |
1014 ;; Properly handle scroll-bar and mode-line clicks | |
1015 ;; for which a dummy prefix event was generated as (aref key 0). | |
1016 (and (> (length key) 1) | |
1017 (symbolp (aref key 0)) | |
1018 (listp (aref key 1)) | |
1019 (consp (posn-point (event-start (aref key 1)))) | |
1020 (setq index 1)) | |
1013 ;; If we got a mouse click, maybe it was read with the buffer | 1021 ;; If we got a mouse click, maybe it was read with the buffer |
1014 ;; it was clicked on. If so, that buffer, not the current one, | 1022 ;; it was clicked on. If so, that buffer, not the current one, |
1015 ;; is in isearch mode. So end the search in that buffer. | 1023 ;; is in isearch mode. So end the search in that buffer. |
1016 (if (and (listp (aref key 0)) | 1024 (if (and (listp (aref key index)) |
1017 (setq window (posn-window (event-start (aref key 0)))) | 1025 (setq window (posn-window (event-start (aref key index)))) |
1018 (windowp window)) | 1026 (windowp window)) |
1019 (save-excursion | 1027 (save-excursion |
1020 (set-buffer (window-buffer window)) | 1028 (set-buffer (window-buffer window)) |
1021 (isearch-done)) | 1029 (isearch-done)) |
1022 (isearch-done)))) | 1030 (isearch-done)))) |
1023 (t;; otherwise nil | 1031 (t;; otherwise nil |
1024 (isearch-process-search-string (this-command-keys) | 1032 (isearch-process-search-string (this-command-keys) |
1025 (this-command-keys))))) | 1033 (this-command-keys))))) |
1026 | |
1027 | 1034 |
1028 (defun isearch-quote-char () | 1035 (defun isearch-quote-char () |
1029 "Quote special characters for incremental search." | 1036 "Quote special characters for incremental search." |
1030 (interactive) | 1037 (interactive) |
1031 (isearch-process-search-char (read-quoted-char (isearch-message t)))) | 1038 (isearch-process-search-char (read-quoted-char (isearch-message t)))) |