GNU bug report logs -
#37563
27.0.50; fit-frame-to-buffer does not account for line-spacing
Previous Next
Reported by: Ingo Lohmar <ingo.lohmar <at> posteo.net>
Date: Mon, 30 Sep 2019 19:34:01 UTC
Severity: normal
Found in version 27.0.50
Done: Ingo Lohmar <ingo.lohmar <at> posteo.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
I now came up with a fix for 'fit-window-to-buffer' too which had some
strange misbehavior with different size restricting arguments when the
window's text size did not change. See attached diffs and Change Log
below.
> I think I understand better now, I was hampered by some weird debugging
> artifacts in my current setup. With the default
> `frame-resize-pixelwise' of nil, and the otherwise bug-fixed code,
> nothing is cut off, but there is some slack whitespace, indeed.
I suppose that part of that whitespace comes from the fact that with
'line-spacing' greater zero, 'window-text-pixel-size' includes the
space below the last line of its text. It would be nice to get rid of
that but ISTR that a line's text may now get centered within the space
reserved for it. So I cannot just remove the entire line space of one
line from the return value but probably only half of the line spacing
value. How would I know the right value?
martin
Fixes for fitting windows and frames to their buffers (Bug#37563)
* lisp/window.el (window-default-font-height)
(window-default-line-height): New functions.
(fit-frame-to-buffer): Interpret values of MAX-HEIGHT and
MIN-HEIGHT arguments in terms of WINDOW's default line height
(Bug#37563).
(fit-window-to-buffer): Obey size restricting arguments even
when size of WINDOW's text does not change. Do not
temporarily select WINDOW and perform height/width related
calculations if and only if WINDOW is accordingly combined.
Interpret values of MAX-HEIGHT and MIN-HEIGHT arguments in
terms of WINDOW's default line height.
[fit-to-buffer.diffs (text/plain, attachment)]
This bug report was last modified 5 years and 219 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.