GNU bug report logs - #76186
31.0.50; (recenter 0) sometimes does not recenter as expected

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Mon, 10 Feb 2025 21:57:01 UTC

Severity: normal

Found in version 31.0.50

Full log


Message #47 received at 76186 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76186 <at> debbugs.gnu.org, triska <at> metalevel.at
Subject: Re: bug#76186: 31.0.50; (recenter 0) sometimes does not recenter as
 expected
Date: Sat, 22 Feb 2025 14:46:34 +0100
On Sat, 22 Feb 2025 15:32:28 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Stephen Berman <stephen.berman <at> gmx.net>
>> Cc: triska <at> metalevel.at,  76186 <at> debbugs.gnu.org
>> Date: Sat, 22 Feb 2025 14:08:07 +0100
[...]
>> When I start Emacs like this:
>>
>> emacs -Q -l bug#76186.el
>>
>> and, if the mouse pointer is over the Emacs frame, do not touch the
>> mouse, then after 501 iterations the loop stops (I've also done tests
>> with more than 10000 iterations with the same results) and the message
>> "window-start=793, point-max=793 in run 501" is displayed, indicating
>> the expected result of `(recenter 0)'.  However, in the displayed
>> "sample" buffer, point-max is vertically centered in the window (as
>> after `(recenter)') and window-start is 671.
[...]
> Thanks.  I'm afraid I'm none the wiser, because I see none of the
> phenomena you describe on my system.  Whatever I do, the test always
> runs to completion, and the last screen shows point at EOB.

By "runs to completion" I suppose you mean 501 iterations (or whatever
you set n to)?  In this case is the message as above, with window-start
and point-max identical, or does the message show them differing?  The
latter would be unexpected unless the loop stopped before 501 (or n)
iterations.

> Some parts of what you describe seem to indicate that the problem is
> not with 'recenter' itself, but with the following redisplay cycle,
> which, for some reason, considers the window-start position
> inappropriate and recenters point on display.  But I have no idea why,
> and it is impossible to debug this when the problem happens as part of
> 500 iterations.

I agree, and the apparent ineffectiveness of Edebug in this case is also
frustrating.  I could try using gdb with the test configuration where I
consistly get the "unexpected recentering" after one iteration; can you
suggest where to set the break point and any other input that may be
helpful?

Steve Berman




This bug report was last modified 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.