From: Po Lu Date: Fri, 10 May 2024 03:01:29 +0000 (+0800) Subject: Fix bug#70856 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d2e8d2ad264eee01b2f7b8c95cbdbe79bcbf389c;p=emacs.git Fix bug#70856 * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down) (pixel-scroll-precision-scroll-up): Apply finer threshold for the minimum unit of scrolling. (pixel-scroll-precision-scroll-down-page): Document true restrictions on DELTA. (bug#70856) (cherry picked from commit 671c9e08b2286d8c32ac6ca00eadc4c8d5e1d5e4) --- diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 4bf912e54c0..20c7f3fe596 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -501,8 +501,8 @@ Otherwise, redisplay will reset the window's vscroll." ;;;###autoload (defun pixel-scroll-precision-scroll-down-page (delta) "Scroll the current window down by DELTA pixels. -Note that this function doesn't work if DELTA is larger than -the height of the current window." +Note that this function doesn't work if DELTA is larger than or +equal to the height of the current window." (let* ((desired-pos (posn-at-x-y 0 (+ delta (window-tab-line-height) (window-header-line-height)))) @@ -551,8 +551,7 @@ the height of the current window." (defun pixel-scroll-precision-scroll-down (delta) "Scroll the current window down by DELTA pixels." - (let ((max-height (- (window-text-height nil t) - (frame-char-height)))) + (let ((max-height (1- (window-text-height nil t)))) (while (> delta max-height) (pixel-scroll-precision-scroll-down-page max-height) (setq delta (- delta max-height))) @@ -666,8 +665,7 @@ to `pixel-scroll-precision-interpolation-factor'." (defun pixel-scroll-precision-scroll-up (delta) "Scroll the current window up by DELTA pixels." - (let ((max-height (- (window-text-height nil t) - (frame-char-height)))) + (let ((max-height (window-text-height nil t))) (when (> max-height 0) (while (> delta max-height) (pixel-scroll-precision-scroll-up-page max-height)