summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el24
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 90f2b3ba879..d71d80bd41f 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -54,7 +54,7 @@
With the default setting, an ordinary Mouse-1 click on a link
performs the same action as Mouse-2 on that link, while a longer
-Mouse-1 click \(hold down the Mouse-1 button for more than 350
+Mouse-1 click \(hold down the Mouse-1 button for more than 450
milliseconds) performs the original Mouse-1 binding \(which
typically sets point where you click the mouse).
@@ -78,7 +78,7 @@ packages. See `mouse-on-link-p' for details."
:version "22.1"
:type '(choice (const :tag "Disabled" nil)
(const :tag "Double click" double)
- (number :tag "Single click time limit" :value 350)
+ (number :tag "Single click time limit" :value 450)
(other :tag "Single click" t))
:group 'mouse)
@@ -663,7 +663,7 @@ This should be bound to a mouse drag event."
;; If mark is highlighted, no need to bounce the cursor.
;; On X, we highlight while dragging, thus once again no need to bounce.
(or transient-mark-mode
- (memq (framep (selected-frame)) '(x pc w32))
+ (memq (framep (selected-frame)) '(x pc w32 mac))
(sit-for 1))
(push-mark)
(set-mark (point))
@@ -958,12 +958,14 @@ at the same position."
(mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
(if (consp event)
- (let ((fun (key-binding (vector (car event)))))
+ (let* ((fun (key-binding (vector (car event))))
+ (do-multi-click (and (> (event-click-count event) 0)
+ (functionp fun)
+ (not (eq fun 'mouse-set-point)))))
;; Run the binding of the terminating up-event, if possible.
- ;; In the case of a multiple click, it gives the wrong results,
- ;; because it would fail to set up a region.
- (if (not (= (overlay-start mouse-drag-overlay)
- (overlay-end mouse-drag-overlay)))
+ (if (and (not (= (overlay-start mouse-drag-overlay)
+ (overlay-end mouse-drag-overlay)))
+ (not do-multi-click))
(let* ((stop-point
(if (numberp (posn-point (event-end event)))
(posn-point (event-end event))
@@ -996,8 +998,12 @@ at the same position."
(and (mark t) mark-active
(eq buffer (current-buffer))
(mouse-set-region-1))))
- (delete-overlay mouse-drag-overlay)
;; Run the binding of the terminating up-event.
+ ;; If a multiple click is not bound to mouse-set-point,
+ ;; cancel the effects of mouse-move-drag-overlay to
+ ;; avoid producing wrong results.
+ (if do-multi-click (goto-char start-point))
+ (delete-overlay mouse-drag-overlay)
(when (and (functionp fun)
(= start-hscroll (window-hscroll start-window))
;; Don't run the up-event handler if the