Subject: Re: bug#38181: Actual height of mode-line not taken into account

From: Jonas Bernoulli <[email-masked]>
Date: Sun, 17 Nov 2019 17:17:36 +0100

Eli Zaretskii <[email-masked]> writes:

> The problem is that
> this data is recalculated only when the window is redisplayed, so
> without the call to 'redisplay' we use stale data until the next
> redisplay cycle.
>
> However, if all the mode lines have the same height, then the problem
> shouldn't have happened, and so now I wonder what am I missing.

I think the culprit is that we are not reusing some existing window to
display a new buffer but actually split an existing window in two and
then display the new buffer in the new window which never had its mode-
line height calculated.

> If
> you simulate the situation where the mode line changes, while keeping
> its height (even if that height is unusually large), does the problem
> with fit-window-to-buffer still happen?

No, if the mode-line (height) can be "reused", then there is no problem.