Commit 5818408f authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent 1d58ab89
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
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment