changeset 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 ef9f2cfb6703
children 3112c8925d39
files lisp/isearch.el
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/isearch.el	Fri Jul 02 20:07:55 1993 +0000
+++ b/lisp/isearch.el	Fri Jul 02 21:34:15 1993 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
 
-;; |$Date: 1993/06/09 11:53:58 $|$Revision: 1.42 $
+;; |$Date: 1993/06/13 21:43:15 $|$Revision: 1.43 $
 
 ;; This file is not yet part of GNU Emacs, but it is based almost
 ;; entirely on isearch.el which is part of GNU Emacs.
@@ -1008,13 +1008,21 @@
 	 (isearch-edit-string))
 	(search-exit-option
 	 (let ((key (this-command-keys))
+	       (index 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))
+		(consp (posn-point (event-start (aref key 1))))
+		(setq index 1))
 	   ;; 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 0))
-		    (setq window (posn-window (event-start (aref key 0))))
+	   (if (and (listp (aref key index))
+		    (setq window (posn-window (event-start (aref key index))))
 		    (windowp window))
 	       (save-excursion
 		 (set-buffer (window-buffer window))
@@ -1024,7 +1032,6 @@
 	 (isearch-process-search-string (this-command-keys)
 					(this-command-keys)))))
 
-
 (defun isearch-quote-char ()
   "Quote special characters for incremental search."
   (interactive)