aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-08-08 19:16:42 +0000
committerRichard M. Stallman1993-08-08 19:16:42 +0000
commitb80f19281d0831d6a41272604cea8d15ed362eba (patch)
tree5cb1b5bf9c9191d0dcd32d21dfb5a92d6021a1db
parent990ee05951d741e077f91e230a445e412bd4aacc (diff)
downloademacs-b80f19281d0831d6a41272604cea8d15ed362eba.tar.gz
emacs-b80f19281d0831d6a41272604cea8d15ed362eba.zip
(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.
-rw-r--r--lisp/mouse.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 565ef5fd147..24904433905 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -96,6 +96,9 @@ This command must be bound to a mouse click."
96This must be bound to a mouse click." 96This must be bound to a mouse click."
97 (interactive "e") 97 (interactive "e")
98 (let ((posn (event-start click))) 98 (let ((posn (event-start click)))
99 (and (window-minibuffer-p (posn-window posn))
100 (not (minibuffer-window-active-p (posn-window posn)))
101 (error "Minibuffer window is not active"))
99 (select-window (posn-window posn)) 102 (select-window (posn-window posn))
100 (if (numberp (posn-point posn)) 103 (if (numberp (posn-point posn))
101 (goto-char (posn-point posn))))) 104 (goto-char (posn-point posn)))))
@@ -168,8 +171,7 @@ This must be bound to a button-down mouse event."
168 (nth 3 bounds) 171 (nth 3 bounds)
169 ;; Don't count the mode line. 172 ;; Don't count the mode line.
170 (1- (nth 3 bounds))))) 173 (1- (nth 3 bounds)))))
171 (select-window start-window) 174 (mouse-set-point start-event)
172 (goto-char start-point)
173 (move-overlay mouse-drag-overlay 175 (move-overlay mouse-drag-overlay
174 start-point start-point 176 start-point start-point
175 (window-buffer start-window)) 177 (window-buffer start-window))
@@ -219,10 +221,11 @@ This must be bound to a button-down mouse event."
219 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) 221 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
220 (eq (posn-window (event-end event)) start-window) 222 (eq (posn-window (event-end event)) start-window)
221 (numberp (posn-point (event-end event)))) 223 (numberp (posn-point (event-end event))))
222 (goto-char (posn-point (event-end event)))) 224 (progn
223 (if (= (point) start-point) 225 (mouse-set-point event)
224 (deactivate-mark) 226 (if (= (point) start-point)
225 (set-mark start-point)) 227 (deactivate-mark)
228 (set-mark start-point))))
226 (delete-overlay mouse-drag-overlay)))) 229 (delete-overlay mouse-drag-overlay))))
227 230
228;;;! (defun mouse-drag-region (click) 231;;;! (defun mouse-drag-region (click)