summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-08-08 19:16:42 +0000
committerRichard M. Stallman <rms@gnu.org>1993-08-08 19:16:42 +0000
commitb80f19281d0831d6a41272604cea8d15ed362eba (patch)
tree5cb1b5bf9c9191d0dcd32d21dfb5a92d6021a1db /lisp
parent990ee05951d741e077f91e230a445e412bd4aacc (diff)
downloademacs-b80f19281d0831d6a41272604cea8d15ed362eba.tar.gz
emacs-b80f19281d0831d6a41272604cea8d15ed362eba.tar.bz2
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.
Diffstat (limited to 'lisp')
-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."
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 @@ This must be bound to a button-down mouse event."
(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 @@ This must be bound to a button-down mouse event."
(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)