Subject: Re: bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.

From: Keith David Bershatsky <[email-masked]>
Date: Tue, 09 Feb 2016 08:00:33 -0800

Thank you, Eli, for the helpful suggestions mentioned in your last e-mail.  I've incorporated them into the latest draft that is attached, and I've simplified some of the code, and I've added a test to avoid unnecessarily triggering of the `window-scroll-functions` hook.

The issue mentioned in my last email was caused by `font-lock-mode` -- when I turn off `font-lock-mode`, there are a few situations where point remains partially visible at the bottom of the window and redisplay does not catch it -- e.g., when the line that point is on is about 90 percent visible at the bottom of the window.  The test in the `run_window_start_end_hook` realizes that point is partially visible, so the function attached to the `window-start-end-hook` does not fire because point was never fully visible during redisplay.  I'll do some more testing over the next few days to find out exactly where in redisplay the test for partially visible is failing such that redisplay never moves the display up one line to bring it into full view.  And, I'll submit a separate ticket once I've tracked it down or once I've come up with a reproducible test.

The proposed usage of this new hook has been simplified to the following:

(defun window-start-end-hook-fn (win start end pbol-start peol-end fully-p)
  (message "win: %s | start: %s | end: %s | pbol-start: %s | peol-end: %s | fully-p: %s"
    win start end pbol-start peol-end fully-p))

(setq scroll-conservatively 101)

(add-hook 'window-start-end-hook 'window-start-end-hook-fn nil t)