Subject: bug#23098: 25.0.92; (recenter -1) can leave point in the middle of the window

From: Jorgen Schäfer <[email-masked]>
Date: Mon, 28 Mar 2016 13:10:23 +0000

On Sun, Mar 27, 2016 at 12:33 AM John Wiegley <[email-masked]> wrote:

> So is the bug here that it can't be done, or that (recenter -1) by itself
> doesn't do what you think it should?

As an end user, I expect `recenter-to-bottom' to cycle the line with point
on it between the top, middle and bottom of the current window. The problem
described in this report means that Emacs does not actually do this – the
line with point on it does not ever go even near the bottom of the window.

There is a technical reason for this problem: Emacs can not, actually,
display a multi-line overlay only partly. This is a shortcoming of Emacs,
but I assume this is non-trivial to fix. When Emacs notices it can not
fulfill a scroll request, it will use a fall back algorithm.

When I, as a user, try to display a line at the bottom of a window, it
would appear to me that trying to keep the line as close to the bottom as
possible instead of the middle of the window is a better fall back.

Setting scroll-conservatively to a large value is a way for the user to
work around this behavior. But this workaround also affects all the other
times a user tries to scroll the buffer. So this is not a fix, it's a
workaround with unintended and rather large side effects completely
unrelated to this.

A similar problems exist for programmers trying to implement a specific
behavior in buffers without prescribing to users how their normal scrolling
behaves.

This situation strikes me as an issue Emacs could address.

Regards,
Jorgen