1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-23 18:47:57 +00:00

Fix bug #18195 with inaccurate results from window-screen-lines.

lisp/simple.el (default-line-height): A floating-point value of
 line-spacing means a fraction of the default frame font's height,
 not of the font currently used by the 'default' face.  Truncate
 the pixel value, like the display engine does.
 (window-screen-lines): Use window-inside-pixel-edges for
 determining the window height in pixels.
This commit is contained in:
Eli Zaretskii 2014-08-05 16:34:06 +03:00
parent 1d58ab89ca
commit 5818408f50
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2014-08-05 Eli Zaretskii <eliz@gnu.org>
* simple.el (default-line-height): A floating-point value of
line-spacing means a fraction of the default frame font's height,
not of the font currently used by the 'default' face. Truncate
the pixel value, like the display engine does.
(window-screen-lines): Use window-inside-pixel-edges for
determining the window height in pixels. (Bug#18195)
2014-07-29 Eli Zaretskii <eliz@gnu.org>
* tutorial.el (tutorial--display-changes): Accept punctuation

View File

@ -5038,7 +5038,7 @@ or the frame."
0)
0)))
(if (floatp lsp)
(setq lsp (* dfh lsp)))
(setq lsp (truncate (* (frame-char-height) lsp))))
(+ dfh lsp)))
(defun window-screen-lines ()
@ -5050,10 +5050,9 @@ in the window, not in units of the frame's default font, and also accounts
for `line-spacing', if any, defined for the window's buffer or frame.
The value is a floating-point number."
(let ((canonical (window-text-height))
(fch (frame-char-height))
(let ((edges (window-inside-pixel-edges))
(dlh (default-line-height)))
(/ (* (float canonical) fch) dlh)))
(/ (float (- (nth 3 edges) (nth 1 edges))) dlh)))
;; Returns non-nil if partial move was done.
(defun line-move-partial (arg noerror to-end)