GNU bug report logs -
#70386
30.0.50; (recenter 0 t) does not put point on top of the window
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Sun, 14 Apr 2024 16:34:02 UTC
Severity: normal
Found in version 30.0.50
Done: Po Lu <luangruo <at> yahoo.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 70386 <at> debbugs.gnu.org
> Date: Sun, 14 Apr 2024 19:36:04 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> 1. emacs -Q
> >> 2. Insert the following into scratch buffer and put point at "recenter"
> >
> > Which "recenter": the one in the comment or the one in (recenter 0 t) ?
>
> The "(recenter 0 t))" line.
>
> >> (progn
> >> (require 'pixel-scroll)
> >> (pixel-scroll-precision-interpolate
> >> (* -1 (line-pixel-height)
> >> (max 0 (- (count-screen-lines (window-start) (point)) 2)))
> >> nil 1)
> >> ;; Call original recenter for final adjustment.
> >> (recenter 0 t))
> >>
> >> 3. M-x eval-buffer
> >> 4. Observe that scroll is not set to line 0, despite calling `recenter'
> >
> > I don't think I understand what you mean by "scroll is not set to line
> > 0". Please explain in more detail what you expected to happen (and
> > why), and what did happen.
>
> Expected is as per docstring:
>
> With a numeric prefix argument ARG, recenter putting point on screen line ARG
> relative to the selected window.
>
> So, I expect that (recenter 0 t) will put the line at point on top of
> the window and that (recenter 1 t) will put the line at point at the
> second top line.
>
> My expectation is met when I simply do emacs -Q M-: (recenter 0 t) or
> emacs -Q M-: (recenter 1 t) on master.
>
> Observed:
>
> 1. Line at point slowly scrolls up until it reaches top of the window
> (`pixel-scroll-precision-interpolate' call)
>
> 2. Line at point is reset back to its initial scroll position
> (`recenter' call)
What is the "initial scroll position" in this case?
> Sometimes, I also observe line at point moving beyond the screen.
It's inconsistent in my testing: sometimes works as I'd expect, and
sometimes ends up with window's vscroll that is very small: about 1
screen line.
Po Lu, could you please look into this? Something in
pixel-scroll-precision-interpolate is randomly misbehaving, at least
on my system. Since all of this stuff is extremely fragile, it's
possible that one of the recent changes in xdisp.c broke it somehow.
But the behavior is not consistent, so I wonder what could cause that.
This bug report was last modified 362 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.