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: Yuan Fu
Subject: Re: Set-window-vscroll sometimes doesn't work
Date: Fri, 23 Oct 2020 16:30:40 -0400


> On Oct 23, 2020, at 2:11 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Fri, 23 Oct 2020 12:48:54 -0400
>> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>> 
>>> FTR, in my testing, I just visited an image file, enlarged it to be
>>> larger than the window, and then invoked C-n with a numeric argument.
>>> Your buffer has more stuff, which might make a difference.
>>> 
>> 
>> In image-mode, C-n is bound to image-next-line, not next-line.
> 
> OK, but how does this change anything in the context of the discussion
> we are having?
> 

I was just mentioning that current implementation of next-line and friends only 
handle a limited use case (ARG=1) and what they do doesn’t provide enough 
inspiration to solve my problem. They never set window-start and vscroll in the 
same time because they don’t need to.

Technically my problem isn’t a real problem, since it works, but of course I 
want to do the right thing. Again, judging by my reading of the code in 
xdisp.c, setting window-start and vscroll doesn’t seem to harm too much.

I really need to set them in the same time because when I scroll down, and 
stopped at a tall image (or tall line), I don’t want to scroll to the top of 
that image immediately. Instead, I want to scroll just enough to show the 
bottom of it. This requires setting window-start to that image and set vscroll 
= image height - line height.

So maybe setting both window-start and vscroll should be considered as a valid 
thing to do?

Yuan


reply via email to

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