From b80f19281d0831d6a41272604cea8d15ed362eba Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 8 Aug 1993 19:16:42 +0000 Subject: [PATCH] (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. --- lisp/mouse.el | 15 +++++++++------ 1 file 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) -- 2.39.5