diff options
Diffstat (limited to 'lisp/pixel-scroll.el')
-rw-r--r-- | lisp/pixel-scroll.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 54d45b39890..dfd9a5ad5b3 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -97,18 +97,16 @@ When scrolling request is delivered soon after the previous one, user is in hurry. When the time since last scroll is larger than `pixel-dead-time', we are ready for another smooth scroll, and this function returns nil." - (let* ((current-time (float-time)) - (scroll-in-rush-p (< (- current-time pixel-last-scroll-time) - pixel-dead-time))) - (setq pixel-last-scroll-time current-time) + (let* ((now (current-time)) + (scroll-in-rush-p (time-less-p + (time-subtract now pixel-last-scroll-time) + pixel-dead-time))) + (setq pixel-last-scroll-time (float-time now)) scroll-in-rush-p)) ;;;###autoload (define-minor-mode pixel-scroll-mode - "A minor mode to scroll text pixel-by-pixel. -With a prefix argument ARG, enable Pixel Scroll mode if ARG is positive, -and disable it otherwise. If called from Lisp, enable Pixel Scroll mode -if ARG is omitted or nil." + "A minor mode to scroll text pixel-by-pixel." :init-value nil :group 'scrolling :global t |