Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Why do you need the value as generated from the GUARANTEE=nil
instead of GUARANTEE=t ?
Because it covers the whole window, including the clipped line. With
the GUARANTEE value, I need to apply (forward-line) twice to the value
But I could live with either, it's not that important. Consistency
> > > OK, but this isn't really the same problem.
> Huh? It is quite obvious that lack of redisplay causes
> window-start to return the wrong value. If my understanding is
> correct, the GUARANTEE argument was invented *exactly* for that
> purpose -- to get the correct value without forcing a redisplay.
No it is not the lack of redisplay it is the lack of scrolling.
Maybe that code is completely intertwined but it is conceptually
One of the basic postulates of our redisplay mechanism is that
scrolling is tightly integrated with redisplay. Chuck Thompson put it
The traditional scrolling code in Emacs breaks in a variable
height world. It depends on the key assumption that the number of
lines that can be displayed at any given time is fixed. This led
to a complete separation of the scrolling code from the redisplay
code. In order to fully support variable height lines, the
scrolling code must actually be tightly integrated with redisplay.
Only redisplay can determine how many lines will be displayed on a
screen for any given starting point.
And so on.
I am not denying that window-start doesn't need fixing. I am
trying to explain why there is currently a difference between the
I admit I fail to understand your explanation. Looking at the code,
it seems that window-end employs the line-start cache in the GUARANTEE
case, while window-start always returns the stored value.
I have no idea if it is feasible to use the line-start cache for the
purposes of window-start. It may be hard or impossible. It may also
be that the implementor of GUARANTEE simply forgot about window-start,
or that he didn't feel like doing it at the time.
(To my dismay, the change to window-end is not mentioned in the
ChangeLog. Neither is it documented in Lispref.)