diff options
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 698c2ce9909..835eaa32c61 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -98,7 +98,7 @@ point at the click position." (defun mouse--down-1-maybe-follows-link (&optional _prompt) (when mouse-1-click-follows-link - (setq mouse--last-down (cons (car-safe last-input-event) (float-time)))) + (setq mouse--last-down (cons (car-safe last-input-event) (current-time)))) nil) (defun mouse--click-1-maybe-follows-link (&optional _prompt) @@ -110,8 +110,10 @@ Expects to be bound to `(double-)mouse-1' in `key-translation-map'." ('double (eq 'double-mouse-1 (car-safe last-input-event))) (_ (and (eq 'mouse-1 (car-safe last-input-event)) (or (not (numberp mouse-1-click-follows-link)) - (funcall (if (< mouse-1-click-follows-link 0) #'> #'<) - (- (float-time) (cdr mouse--last-down)) + (funcall (if (< mouse-1-click-follows-link 0) + (lambda (a b) (time-less-p b a)) + #'time-less-p) + (time-since (cdr mouse--last-down)) (/ (abs mouse-1-click-follows-link) 1000.0)))))) (eq (car mouse--last-down) (event-convert-list (list 'down (car-safe last-input-event)))) |