emacs-devel
[Top][All Lists]
Advanced

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

Re: Redisplay resets vscroll when window start changes


From: Eli Zaretskii
Subject: Re: Redisplay resets vscroll when window start changes
Date: Wed, 17 Nov 2021 15:40:06 +0200

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Po Lu <luangruo@yahoo.com>,  mwd@md5i.com,  emacs-devel@gnu.org
> Date: Tue, 16 Nov 2021 22:40:35 -0500
> 
> I'm still not sure how/why line-move should affect vscroll.

Because it needs to handle the case of scrolling through a very tall
image.  When that scrolling shows the last (bottom-most) portion of
the image, the next C-n should go to the next screen line, and that
means zero out the vscroll.  Conversely, when we show only the upper
portion of the image, the next C-n should increase vscroll to show its
lower portions.

> AFAIK while line-move does use some of the redisplay code, in theory at
> least its effect should only ever be to move point (i.e. when called
> within a `save-excursion` it should end up having no effect at all).

If you only move point, but leave vscroll at zero, you will never be
able to show the parts of the image that exceed the window's height.

> Would there be a way to distinguish the case where line-move can return
> a correct result without changing vscroll, from the case where it does
> require changing vscroll in order to find its answer?

I don't think I understand the question.  It might be worthwhile to
keep in mind that the display engine (almost) never changes vscroll,
so if you want it to show a large object at some position, you must
manipulate vscroll from Lisp.



reply via email to

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