diff options
-rw-r--r-- | lisp/pixel-scroll.el | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 2e09f9af2d4..10736de2ae4 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -141,6 +141,18 @@ Nil means to not interpolate such scrolls." 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, @@ -531,7 +543,8 @@ This results in the window being scrolled by DELTA pixels with an 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) @@ -540,10 +553,10 @@ animation." 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))))) @@ -691,6 +704,8 @@ precisely, according to the turning of the mouse wheel." :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) |