number)
:version "29.1")
+(defcustom pixel-scroll-precision-interpolation-total-time 0.01
+ "The total time in seconds to spend interpolating a large scroll."
+ :group 'mouse
+ :type 'float
+ :version 29.1)
+
+(defcustom pixel-scroll-precision-interpolation-factor 2.0
+ "A factor to apply to the distance of an interpolated scroll."
+ :group 'mouse
+ :type 'float
+ :version 29.1)
+
(defun pixel-scroll-in-rush-p ()
"Return non-nil if next scroll should be non-smooth.
When scrolling request is delivered soon after the previous one,
animation."
(while-no-input
(let ((percentage 0)
- (total-time 0.01)
+ (total-time pixel-scroll-precision-interpolation-total-time)
+ (factor pixel-scroll-precision-interpolation-factor)
(time-elapsed 0.0)
(between-scroll 0.001))
(while (< percentage 1)
percentage (/ time-elapsed total-time))
(if (< delta 0)
(pixel-scroll-precision-scroll-down
- (ceiling (abs (* delta
+ (ceiling (abs (* (* delta factor)
(/ between-scroll total-time)))))
(pixel-scroll-precision-scroll-up
- (ceiling (* delta
+ (ceiling (* (* delta factor)
(/ between-scroll total-time)))))
(redisplay t)))))
:group 'mouse
:keymap pixel-scroll-precision-mode-map
(setq mwheel-coalesce-scroll-events
+ (not pixel-scroll-precision-mode)
+ make-cursor-line-fully-visible
(not pixel-scroll-precision-mode)))
(provide 'pixel-scroll)