Subject: bug#18357: 24.3.93; Calendar not fully displayed

From: martin rudalics <[email-masked]>
Date: Sat, 30 Aug 2014 19:15:54 +0200

>> The mode line face specifies the height of the mode line.  IIUC
 >> `fit-window-to-buffer' gets this height via CURRENT_MODE_LINE_HEIGHT (in
 >> dispextern.h) which is likely wrong if the font has not been applied yet
 >> to the target window.
 >
 > Yes, but the original recipe involved Customize to change the
 > mode-line face, so in that case the changes in the mode-line face have
 > propagated long ago by the time "M-x calendar" is invoked.

They propagated to the selected window only.  The calendar window does
not even exist at that time.

 > So I don't see how the above explanation could be relevant to the
 > original issue.

I have no other one.  The scenarios differ in one point: In mine the
mode lines of all windows are the same height, but
`fit-window-to-buffer' doesn't know that height yet when it's executed.

For Stephen's the estimate is for a non-selected window and `calendar'
selects the window _after_ `fit-window-to-buffer' was executed.

If you have a better explanation, I'll be all ears.

 >> Note that we allow the font to change the height of the mode line which
 >> may partially overwrite the last line(s) of the window text.  This seems
 >> to backfire here
 >
 > I see no "backfire".  Emacs scrolls the window to make point fully
 > visible, that's all.

It backfires because `fit-window-to-buffer' can't make the window tall
enough since it doesn't yet know how large the mode line will be.  And
since it never will be clairvoyant enough to know which window will be
selected, I see no chance to reliably fix Stephen's scenario.

martin