Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Hrvoje Niksic <hniksic(a)srce.hr> writes:
> Because it covers the whole window, including the clipped line. With
> the GUARANTEE value, I need to apply (forward-line) twice to the value
> I get.
Aha.. I understand now I was not reading correctly. Then the
GUARANTEE is also wrong, IMHO it should return the position of the
last visible char including that one on the clipped line.
That would be unlike anything else in Emacs. I can certainly imagine
(point-max) returning the location of the last char in the buffer, but
that's not how Emacs works.
This is the last line you can reach with the cursor.A
This is the clipped line, which is infact also brok\B
Cen because it is too long.
DThis is is the first line in the buffer that is not visible.
so (window-end) gives D, (window-end nil t) gives A, and I think the
correct answer is B.
(window-end) returns the location of C, and that's IMO exactly right.
It's only that when you are at the end of the buffer that (window-end)
returns (1+ (point-max)), which is IMO wrong.