diff options
| -rw-r--r-- | lisp/mouse.el | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index be760126499..b0044a4a991 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -585,8 +585,27 @@ remains active. Otherwise, it remains until the next input event." | |||
| 585 | (setq end-of-range (overlay-start mouse-drag-overlay))) | 585 | (setq end-of-range (overlay-start mouse-drag-overlay))) |
| 586 | ((>= mouse-row bottom) | 586 | ((>= mouse-row bottom) |
| 587 | (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) | 587 | (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) |
| 588 | mouse-drag-overlay start-point) | 588 | a mouse-drag-overlay start-point) |
| 589 | (setq end-of-range (overlay-end mouse-drag-overlay)))))))))) | 589 | (setq end-of-range (overlay-end mouse-drag-overlay)))))))))) |
| 590 | ;; In case we did not get a mouse-motion event | ||
| 591 | ;; for the final move of the mouse before a drag event | ||
| 592 | ;; pretend that we did get one. | ||
| 593 | (when (and (memq 'drag (event-modifiers (car-safe event))) | ||
| 594 | (setq end (event-end event) | ||
| 595 | end-point (posn-point end)) | ||
| 596 | (eq (posn-window end) start-window) | ||
| 597 | (integer-or-marker-p end-point)) | ||
| 598 | |||
| 599 | ;; Go to START-POINT first, so that when we move to END-POINT, | ||
| 600 | ;; if it's in the middle of intangible text, | ||
| 601 | ;; point jumps in the direction away from START-POINT. | ||
| 602 | (goto-char start-point) | ||
| 603 | (goto-char end-point) | ||
| 604 | (if (zerop (% click-count 3)) | ||
| 605 | (setq end-of-range (point))) | ||
| 606 | (let ((range (mouse-start-end start-point (point) click-count))) | ||
| 607 | (move-overlay mouse-drag-overlay (car range) (nth 1 range)))) | ||
| 608 | |||
| 590 | (if (consp event) | 609 | (if (consp event) |
| 591 | (let ((fun (key-binding (vector (car event))))) | 610 | (let ((fun (key-binding (vector (car event))))) |
| 592 | ;; Run the binding of the terminating up-event, if possible. | 611 | ;; Run the binding of the terminating up-event, if possible. |