bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54894: 28.1; window-body-height returns wrong result if line-spacing


From: Eli Zaretskii
Subject: bug#54894: 28.1; window-body-height returns wrong result if line-spacing is non-nil
Date: Wed, 13 Apr 2022 05:27:56 +0300

> Date: Tue, 12 Apr 2022 22:38:30 +0200
> From: Christoph Arenz <tiga.arenz@web.de>
> 
> Help for window-body-height says:
> (window-body-height &optional WINDOW PIXELWISE)
> 
> Return the height of WINDOW’s text area.
> WINDOW must be a live window and defaults to the selected one.  Optional
> argument PIXELWISE non-nil means return the height of WINDOW’s text area
> in pixels.  The return value does not include the mode line or header
> line or any horizontal divider.
> 
> If PIXELWISE is nil, return the largest integer smaller than WINDOW’s
> pixel height divided by the character height of WINDOW’s frame.  This
> means that if a line at the bottom of the text area is only partially
> visible, that line is not counted.
> ----------
> 
> It seems the case with PIXELWISE being nil is not handled correctly when
> line-spacing is non-nil.

It does handle that correctly.  Like with most (if not all) functions
that return window and frame dimensions, the return value is in unit
of a canonical line height for the frame.  It doesn't count the actual
text lines.  So it isn't affected by stuff like line-spacing, the
actual height of the lines due to changes in fonts, etc.

This is not a bug, but the intended behavior.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]