diff lisp/mouse.el @ 4490:8362b57424dc

(mouse-set-point): Error if click in inactive minibuffer. (mouse-drag-region): Use mouse-set-point. Don't set a mark if final event wasn't suitable for setting point.
author Richard M. Stallman <rms@gnu.org>
date Sun, 08 Aug 1993 19:16:42 +0000
parents 951f354907d8
children c2afed091afb
line wrap: on
line diff
--- a/lisp/mouse.el	Sun Aug 08 17:43:28 1993 +0000
+++ b/lisp/mouse.el	Sun Aug 08 19:16:42 1993 +0000
@@ -96,6 +96,9 @@
 This must be bound to a mouse click."
   (interactive "e")
   (let ((posn (event-start click)))
+    (and (window-minibuffer-p (posn-window posn))
+	 (not (minibuffer-window-active-p (posn-window posn)))
+	 (error "Minibuffer window is not active"))
     (select-window (posn-window posn))
     (if (numberp (posn-point posn))
 	(goto-char (posn-point posn)))))
@@ -168,8 +171,7 @@
 		     (nth 3 bounds)
 		   ;; Don't count the mode line.
 		   (1- (nth 3 bounds)))))
-    (select-window start-window)
-    (goto-char start-point)
+    (mouse-set-point start-event)
     (move-overlay mouse-drag-overlay
 		  start-point start-point
 		  (window-buffer start-window))
@@ -219,10 +221,11 @@
       (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
 	       (eq (posn-window (event-end event)) start-window)
 	       (numberp (posn-point (event-end event))))
-	  (goto-char (posn-point (event-end event))))
-      (if (= (point) start-point)
-	  (deactivate-mark)
-	(set-mark start-point))
+	  (progn
+	    (mouse-set-point event)
+	    (if (= (point) start-point)
+		(deactivate-mark)
+	      (set-mark start-point))))
       (delete-overlay mouse-drag-overlay))))
 
 ;;;! (defun mouse-drag-region (click)