Subject: Re: bug#17678: 24.4.50; Feature Request -- calculate new `window-start` & `window-end` before visual redisplay

From: Eli Zaretskii <[email-masked]>
Date: Fri, 13 Jun 2014 09:22:23 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 12 Jun 2014 22:11:39 -0400
> 
> >> > The display engine changes window-start for several reasons, only one
> >> > of them being that point moved off screen.
> >> Is there a comment somewhere that documents the cases where it can happen?
> > Not that I know of.
> > In general, there are functions that set the window-start forcibly.
> 
> I know of code that does that from outside of redisplay, but within
> redisplay I only know of the "move point back into view".

Why does it matter if the trigger comes from outside redisplay or as
part of redisplay?

Anyway, one situation of the latter kind is when the text at
window-start changed.  Another one is when the window-start was in a
continuation line, and the window width changed, see
compute_window_start_on_continuation_line and its callers.