Subject: Emacs now recentering very aggressively

From: Dale Sedivec <[email-masked]>
Date: Thu, 10 Sep 2020 16:18:55 -0500

Hi, as of commit a07ec21bf24b, which is said to address bug #42653, Emacs started recentering as I scroll up.  Here's a minimal reproduction case:

1. emacs -Q

2. Display anything in the header line: (setq-default header-line-format "foo")

3. Open any file longer than a few screenfuls: M-x find-library RET subr RET

4. Enable which-function-mode: M-x which-function-mode RET

(display-line-numbers-mode also triggers this problem, but I find which-function-mode more interesting since it doesn't change the display of the buffer at all, only the mode line.)

5. M-> (end-of-buffer)

6. Page up a few times with M-v (scroll-down-command)

Expected behavior: Point is sitting at the bottom line of the window no matter how many times you page up

Observed behavior: The window is recentered, usually after ever page up, with a slight delay

Here's a video of this behavior, in case it helps: https://www.dropbox.com/s/i7m2h9ltwrpxxy3/emacs_scrolling.mp4?dl=0

emacs-version: GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G6020)) of 2020-09-10

I built this today from master, 70a8d06fe1.

I can stop this from happening with (setq scroll-conservatively 101), so perhaps the behavior is intentional?  However, the fact that point stays at the bottom of the window for a brief instant, and then only recenters when (I am **guessing**) which-func-update runs leads me to believe this is unintentional behavior.

Please let me know if you need any more information.

Regards,
Dale