:type 'float
:version "29.1")
-(defcustom pixel-scroll-precision-interpolation-factor 4.0
+(defcustom pixel-scroll-precision-interpolation-factor 2.0
"A factor to apply to the distance of an interpolated scroll."
:group 'mouse
:type 'float
(selected-window))
(redisplay t))
(sleep-for between-scroll)
- (setq time-elapsed (+ time-elapsed
- (- (float-time) last-time))
- percentage (/ time-elapsed total-time))
- (let* ((throw-on-input nil)
- (absolute-delta (* (min 1 percentage) delta factor))
- (relative-delta (abs
- (round (- absolute-delta last-delta)))))
- (setq last-delta absolute-delta)
- (if (< delta 0)
- (pixel-scroll-precision-scroll-down relative-delta)
- (pixel-scroll-precision-scroll-up relative-delta)))
- (setq last-time (float-time)))
+ (let ((time (float-time)))
+ (setq time-elapsed (+ time-elapsed
+ (- time last-time))
+ percentage (/ time-elapsed total-time))
+ (let* ((throw-on-input nil)
+ (absolute-delta (* (min 1 percentage) delta factor))
+ (relative-delta (abs
+ (round (- absolute-delta last-delta)))))
+ (setq last-delta absolute-delta)
+ (if (< delta 0)
+ (pixel-scroll-precision-scroll-down relative-delta)
+ (pixel-scroll-precision-scroll-up relative-delta)))
+ (setq last-time time)))
(if (< percentage 1)
(progn
(set-window-parameter nil 'interpolated-scroll-remainder
;; interpolation factor,
;; since we want exactly 1
;; page to be scrolled.
- 0)
+ nil 1)
(cua-scroll-up)))
(defun pixel-scroll-interpolate-up ()
(interactive)
(if pixel-scroll-precision-interpolate-page
(pixel-scroll-precision-interpolate (window-text-height nil t)
- 0)
+ nil 1)
(cua-scroll-down)))
;;;###autoload