help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set-window-vscroll sometimes doesn't work


From: Eli Zaretskii
Subject: Re: Set-window-vscroll sometimes doesn't work
Date: Thu, 22 Oct 2020 19:05:01 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Wed, 21 Oct 2020 15:05:26 -0400
> Cc: help-gnu-emacs@gnu.org
> 
>  But my point was that you shouldn't set window-start if you need to
>  use a non-zero vscroll.
> 
> It does: mwheel-scroll calls scroll-down/up, which calls 
> window_scroll_pixel_based, which sets w->start
> (and it sets vscroll for tall image).

If you examine the code in window_scroll_pixel_based carefully, you
will see that it either sets vscroll or w->start, but never both.

>  next-line and friends only vscroll when scroll-conservatively=0 and ARG=1, 
> which allows it to get
>  away from the problem I face (set-window-start and set-window-vscroll in the 
> same time). I either
>  implements smooth scrolling to only work when ARG=1 or I need to set both 
> value at the same
>  time.
> 
>  I don't understand why you say this.  First, C-n works on tall images
>  with arguments greater than 1.  And second, I still don't understand
>  why you need to set window-start, because vscroll should be enough for
>  your needs, as far as I understand.
> 
> C-n doesn’t smooth scroll on tall images when ARG > 1: The code checks for 
> ARG = 1, if not, it doesn’t do
> line-move-partial. I also tried C-2 C-n, no smooth scrolling.

What do you mean by "smooth scrolling" here?  If I invoke C-2 C-n" on
a large image, the image gets scrolled by the amount of pixels that is
equivalent to 2 screen lines.  Isn't that what you see?

> I thought vscroll is a relative measure and is measured against window-start. 
> And it kind of makes sense to
> set a window start as the basis and set vscroll based on that. So I kind of 
> assumed that window-start is
> always at least partially visible and vscroll is always less than the height 
> of the first line. Now, if I throw away
> window-start and scrolls entirely by vscroll, will there be any problems? 
> Like, does anyone relies on
> window-start being visible? I felt like that’s what people uses to get the 
> first line displayed in the window.

When vscroll is so large that the window-start point is entirely not
visible, you should move window-start so it becomes visible.  But that
shouldn't be a problem, because it means you've scrolled the entire
image off-screen.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]