emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117425: Fix bug #18195 with inaccurate results f


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117425: Fix bug #18195 with inaccurate results from window-screen-lines.
Date: Tue, 05 Aug 2014 13:34:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117425
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18195
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-08-05 16:34:06 +0300
message:
  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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/simple.el                 simple.el-20091113204419-o5vbwnq5f7feedwu-403
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-07-29 13:41:50 +0000
+++ b/lisp/ChangeLog    2014-08-05 13:34:06 +0000
@@ -1,3 +1,12 @@
+2014-08-05  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 
        * tutorial.el (tutorial--display-changes): Accept punctuation

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2014-06-20 00:14:43 +0000
+++ b/lisp/simple.el    2014-08-05 13:34:06 +0000
@@ -5038,7 +5038,7 @@
                     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 @@
 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)


reply via email to

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