|
From: | Christoph Arenz |
Subject: | bug#54894: 28.1; window-body-height returns wrong result if line-spacing is non-nil |
Date: | Tue, 12 Apr 2022 22:38:30 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 |
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.
How to recreate:
Good case:
1. emacs -Q
2. C-h C-c ;; fill buffer window full of text
3. M-r M-r M-r ;; Note line number of lowest line in window in
the mode
line -- in my case L34
4. M-x (window-body-height) ;; in my case also returning 34
Bad case:
5. M-: (setq line-spacing 2) ;; increase line spacing and create
partial
last line
6. M-< ;; goto beginning of buffer
7. M-r M-r M-r ;; Note line number of lowest FULL line in window
in the mode
line; in my case L30
8. M-x (window-body-height) ;; in my case STILL returning 34
9. M-x (floor (/
(window-body-height nil t) (line-pixel-height))) ;;
this results to 30 as would be the expected result in line 8.
In GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.22.30, cairo version 1.15.10)
of 2022-04-08 built on M92p
Repository revision: 5a223c7f2ef4c31abbd46367b6ea83cd19d30aa7
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version
11.0.11906000
System Description: Ubuntu 18.04.6 LTS
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS
HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER
PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE
XIM XPM
GTK3 ZLIB
Important settings:
value of $LC_MONETARY: de_DE.UTF-8
value of $LC_NUMERIC: de_DE.UTF-8
value of $LC_TIME: de_DE.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
[Prev in Thread] | Current Thread | [Next in Thread] |