Subject: bug#61307: 30.0.50; pixel-scroll-precision-mode: window-scroll-functions?

From: Michael Heerdegen <[email-masked]>
Date: Tue, 14 Feb 2023 02:30:10 +0100

Eli Zaretskii <[email-masked]> writes:

> > Don't all other scroll commands scroll after every single command
> > invocation?  Why is this one different?
>
> Because you might make scrolling much slower if you call the scroll
> functions every pixel.

Sorry that I repeat myself, but I don't understand why that would
happen.  This is what I tried:

*** /tmp/ediffnuE8b2	2023-02-14 02:24:24.300444006 +0100
--- /home/micha/software/emacs/lisp/pixel-scroll.el	2023-02-14 02:20:40.472154353 +0100
***************
*** 725,731 ****
                      (beginning-of-buffer
                       (message (error-message-string '(beginning-of-buffer))))
                      (end-of-buffer
!                      (message (error-message-string '(end-of-buffer))))))))))
        (mwheel-scroll event nil))))

  (defun pixel-scroll-kinetic-state (&optional window)
--- 725,733 ----
                      (beginning-of-buffer
                       (message (error-message-string '(beginning-of-buffer))))
                      (end-of-buffer
!                      (message (error-message-string '(end-of-buffer))))))
!                 (run-hook-with-args 'window-scroll-functions
!                                     (selected-window) (window-start))))))
        (mwheel-scroll event nil))))

  (defun pixel-scroll-kinetic-state (&optional window)

I don't see the hook called for each pixel.  What do you mean?

A second thing I wonder about: the docstring of
`window-scroll-functions' says:

| These functions are called whenever the `window-start' marker is modified,
| either to point into another buffer (e.g. via `set-window-buffer') or another
| place in the same buffer.

Is this correct and complete?  Is the window-start marker modified in
our scenario?  If it is, why do we have to call the hook explicitly?  If
it is not, should we update that marker?

TIA,

Michael.