+ ;; In case we did not get a mouse-motion event
+ ;; for the final move of the mouse before a drag event
+ ;; pretend that we did get one.
+ (when (and (memq 'drag (event-modifiers (car-safe event)))
+ (setq end (event-end event)
+ end-point (posn-point end))
+ (eq (posn-window end) start-window)
+ (integer-or-marker-p end-point))
+
+ ;; Go to START-POINT first, so that when we move to END-POINT,
+ ;; if it's in the middle of intangible text,
+ ;; point jumps in the direction away from START-POINT.
+ (goto-char start-point)
+ (goto-char end-point)
+ (if (zerop (% click-count 3))
+ (setq end-of-range (point)))
+ (let ((range (mouse-start-end start-point (point) click-count)))
+ (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
+