changeset 9934:4c3ab9b8d1a9

(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.
author Richard M. Stallman <rms@gnu.org>
date Tue, 15 Nov 1994 16:53:29 +0000
parents d3f22955b872
children a36d24b4b365
files lisp/isearch.el
diffstat 1 files changed, 18 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/isearch.el	Tue Nov 15 14:01:12 1994 +0000
+++ b/lisp/isearch.el	Tue Nov 15 16:53:29 1994 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 
-;; |$Date: 1994/09/30 09:16:06 $|$Revision: 1.74 $
+;; |$Date: 1994/11/01 04:20:43 $|$Revision: 1.75 $
 
 ;; This file is part of GNU Emacs.
 
@@ -1035,24 +1035,30 @@
 	   (apply 'isearch-unread (listify-key-sequence key)))
 	 (isearch-edit-string))
 	(search-exit-option
-	 (let ((key (this-command-keys))
-	       (index 0)
-	       window)
+	 (let* ((key (this-command-keys))
+		(main-event (aref key 0))
+		window)
 	   (apply 'isearch-unread (listify-key-sequence key))
 	   ;; Properly handle scroll-bar and mode-line clicks
 	   ;; for which a dummy prefix event was generated as (aref key 0).
 	   (and (> (length key) 1)
 		(symbolp (aref key 0))
 		(listp (aref key 1))
-		;; These events now have a symbol; they used to have a list.
-		;; Accept either one.  Other events have a number here.
 		(not (numberp (posn-point (event-start (aref key 1)))))
-		(setq index 1))
+		;; Convert the event back into its raw form,
+		;; with the dummy prefix implicit in the mouse event,
+		;; so it will get split up once again.
+		(progn (setq foo key)
+		       (setq unread-command-events
+			     (cdr unread-command-events))
+		       (setq main-event (car unread-command-events))
+		       (setcar (cdr (event-start main-event))
+			       (car (nth 1 (event-start main-event))))))
 	   ;; If we got a mouse click, maybe it was read with the buffer
 	   ;; it was clicked on.  If so, that buffer, not the current one,
 	   ;; is in isearch mode.  So end the search in that buffer.
-	   (if (and (listp (aref key index))
-		    (setq window (posn-window (event-start (aref key index))))
+	   (if (and (listp main-event)
+		    (setq window (posn-window (event-start main-event)))
 		    (windowp window))
 	       (save-excursion
 		 (set-buffer (window-buffer window))
@@ -1419,20 +1425,10 @@
       (text-char-description c)
     (isearch-char-to-string c)))
 
+;; General function to unread characters or events.
 (defun isearch-unread (&rest char-or-events)
-  ;; General function to unread characters or events.
-  (if isearch-gnu-emacs-events
-      (setq unread-command-events
-	    (append char-or-events unread-command-events))
-    (let ((char (if (cdr char-or-events)
-		    (progn
-		      (while (cdr char-or-events)
-			(setq char-or-events (cdr char-or-events)))
-		      (+ 128 (car char-or-events)))
-		  (car char-or-events))))
-      (if isearch-event-data-type
-	  (setq unread-command-event char)
-	(setq unread-command-char char)))))
+  (setq unread-command-events
+	(append char-or-events unread-command-events)))
 
 (defun isearch-last-command-char ()
   ;; General function to return the last command character.