Subject: Re: bug#37563: 27.0.50; fit-frame-to-buffer does not account for line-spacing

From: martin rudalics <[email-masked]>
Date: Thu, 3 Oct 2019 10:15:11 +0200

> Agreed.  But if I change 'fit-frame-to-buffer', then, for consistency,
 > I have to at least change 'fit-window-to-buffer' too.
 >
 >  > +          (setq height (* (/ (+ height line-height -1) line-height)
 >  > +                          line-height)))
 > [...]
 >  > And then char-height can be dropped.
 >
 > Right.

Hmm...  Back to the roots, unfortunately.

When we are here, 'height' is the calculated height the window should
have in pixels.  When we want to communicate this value to the window
manager and 'frame-resize-pixelwise' is nil, we have to transform this
value (which already includes the pixels needed for line spacing) to a
multiple of the canonical character height of the frame and not the
line height we calculated earlier.  So using 'line-height' here is not
the TRT unless I'm missing something.  WDYT?

martin

PS: My 'window-line-height' must be renamed to not clash with the
homonymous function in window.c.  It will probably become something
like 'window-default-line-height' unless I manage to merge it into
'default-line-height' itself.