Subject: Re: bug#76186: 31.0.50; (recenter 0) sometimes does not recenter as expected

From: Markus Triska <[email-masked]>
Date: Thu, 13 Feb 2025 22:35:10 +0100

Eli Zaretskii <[email-masked]> writes:

> Is position of point-max relative to the bottom of the window also the
> same in the cases where this happens and in those it doesn't?

In all cases where I can elicit the issue, point-max is at the same
position relative to the bottom of the window, and it is always on line
10 out of 17 fully visible lines in total.

I have uploaded a screenshot that shows the situation when the issue arises:

    https://www.metalevel.at/ei/recenter_sometimes_not_recentering.png

After each iteration of the loop, the expected situation is that the
cursor (which is then at point-max) is in the very first visible line of
the window, and that (window-start) is equal to (point-max), and that is
also what the code I posted tests at the end of each iteration. The
expected situation occurs in most iterations, but not in all iterations.

Sometimes the issue happens after 3000 or more iterations in which
recentering works as expected, and it sometimes also takes longer than
10 seconds of running the loop to elicit the issue.