aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-15 16:53:29 +0000
committerRichard M. Stallman1994-11-15 16:53:29 +0000
commitbd1bd1252d893f9fb796faa209fde0d5684b4b79 (patch)
tree0537f33b698bc7b1433742e1e227794f7c0cee77
parent489c043ab7ff9a96bd1077601e9f1be66e33e4ef (diff)
downloademacs-bd1bd1252d893f9fb796faa209fde0d5684b4b79.tar.gz
emacs-bd1bd1252d893f9fb796faa209fde0d5684b4b79.zip
(isearch-unread): Always use unread-command-events.
(isearch-other-meta-char): In the case of a mouse event with a dummy prefix, recombine the two into a single event before unreading.
-rw-r--r--lisp/isearch.el40
1 files changed, 18 insertions, 22 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index b9ebd45c8ae..451e68d3585 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> 5;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
6 6
7;; |$Date: 1994/09/30 09:16:06 $|$Revision: 1.74 $ 7;; |$Date: 1994/11/01 04:20:43 $|$Revision: 1.75 $
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10 10
@@ -1035,24 +1035,30 @@ and the meta character is unread so that it applies to editing the string."
1035 (apply 'isearch-unread (listify-key-sequence key))) 1035 (apply 'isearch-unread (listify-key-sequence key)))
1036 (isearch-edit-string)) 1036 (isearch-edit-string))
1037 (search-exit-option 1037 (search-exit-option
1038 (let ((key (this-command-keys)) 1038 (let* ((key (this-command-keys))
1039 (index 0) 1039 (main-event (aref key 0))
1040 window) 1040 window)
1041 (apply 'isearch-unread (listify-key-sequence key)) 1041 (apply 'isearch-unread (listify-key-sequence key))
1042 ;; Properly handle scroll-bar and mode-line clicks 1042 ;; Properly handle scroll-bar and mode-line clicks
1043 ;; for which a dummy prefix event was generated as (aref key 0). 1043 ;; for which a dummy prefix event was generated as (aref key 0).
1044 (and (> (length key) 1) 1044 (and (> (length key) 1)
1045 (symbolp (aref key 0)) 1045 (symbolp (aref key 0))
1046 (listp (aref key 1)) 1046 (listp (aref key 1))
1047 ;; These events now have a symbol; they used to have a list.
1048 ;; Accept either one. Other events have a number here.
1049 (not (numberp (posn-point (event-start (aref key 1))))) 1047 (not (numberp (posn-point (event-start (aref key 1)))))
1050 (setq index 1)) 1048 ;; Convert the event back into its raw form,
1049 ;; with the dummy prefix implicit in the mouse event,
1050 ;; so it will get split up once again.
1051 (progn (setq foo key)
1052 (setq unread-command-events
1053 (cdr unread-command-events))
1054 (setq main-event (car unread-command-events))
1055 (setcar (cdr (event-start main-event))
1056 (car (nth 1 (event-start main-event))))))
1051 ;; If we got a mouse click, maybe it was read with the buffer 1057 ;; If we got a mouse click, maybe it was read with the buffer
1052 ;; it was clicked on. If so, that buffer, not the current one, 1058 ;; it was clicked on. If so, that buffer, not the current one,
1053 ;; is in isearch mode. So end the search in that buffer. 1059 ;; is in isearch mode. So end the search in that buffer.
1054 (if (and (listp (aref key index)) 1060 (if (and (listp main-event)
1055 (setq window (posn-window (event-start (aref key index)))) 1061 (setq window (posn-window (event-start main-event)))
1056 (windowp window)) 1062 (windowp window))
1057 (save-excursion 1063 (save-excursion
1058 (set-buffer (window-buffer window)) 1064 (set-buffer (window-buffer window))
@@ -1419,20 +1425,10 @@ since they have special meaning in a regexp."
1419 (text-char-description c) 1425 (text-char-description c)
1420 (isearch-char-to-string c))) 1426 (isearch-char-to-string c)))
1421 1427
1428;; General function to unread characters or events.
1422(defun isearch-unread (&rest char-or-events) 1429(defun isearch-unread (&rest char-or-events)
1423 ;; General function to unread characters or events. 1430 (setq unread-command-events
1424 (if isearch-gnu-emacs-events 1431 (append char-or-events unread-command-events)))
1425 (setq unread-command-events
1426 (append char-or-events unread-command-events))
1427 (let ((char (if (cdr char-or-events)
1428 (progn
1429 (while (cdr char-or-events)
1430 (setq char-or-events (cdr char-or-events)))
1431 (+ 128 (car char-or-events)))
1432 (car char-or-events))))
1433 (if isearch-event-data-type
1434 (setq unread-command-event char)
1435 (setq unread-command-char char)))))
1436 1432
1437(defun isearch-last-command-char () 1433(defun isearch-last-command-char ()
1438 ;; General function to return the last command character. 1434 ;; General function to return the last command character.