From 44dc5252922b9a7bacb679f57e95e5a02a87fa13 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 9 Jan 1995 18:27:32 +0000 Subject: [PATCH] (mouse-drag-region): As once in the past, call the binding of the terminating event. --- lisp/mouse.el | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lisp/mouse.el b/lisp/mouse.el index e73d74dfb42..81fdee47e5a 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -413,20 +413,17 @@ release the mouse button. Otherwise, it does not." (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) mouse-drag-overlay start-point))))))))) (if (consp event) -;;; When we scroll into the mode line or menu bar, or out of the window, -;;; we get events that don't fit these criteria. -;;; (eq (get (event-basic-type event) 'event-kind) 'mouse-click) -;;; (eq (posn-window (event-end event)) start-window) -;;; (numberp (posn-point (event-end event))) (let ((fun (key-binding (vector (car event))))) - (if (not (= (overlay-start mouse-drag-overlay) - (overlay-end mouse-drag-overlay))) - (let (last-command this-command) - (push-mark (overlay-start mouse-drag-overlay) t t) - (goto-char (overlay-end mouse-drag-overlay)) - (copy-region-as-kill (point) (mark t))) - (goto-char (overlay-end mouse-drag-overlay)) - (setq this-command 'mouse-set-point)))) + (if (fboundp fun) + (funcall fun event) + (if (not (= (overlay-start mouse-drag-overlay) + (overlay-end mouse-drag-overlay))) + (let (last-command this-command) + (push-mark (overlay-start mouse-drag-overlay) t t) + (goto-char (overlay-end mouse-drag-overlay)) + (copy-region-as-kill (point) (mark t))) + (goto-char (overlay-end mouse-drag-overlay)) + (setq this-command 'mouse-set-point))))) (delete-overlay mouse-drag-overlay)))) ;; Commands to handle xterm-style multiple clicks. -- 2.39.5