aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2013-07-13 10:26:43 +0300
committerEli Zaretskii2013-07-13 10:26:43 +0300
commit1a67b811cbad70fec1d0eaf7a9e3c66784fe6556 (patch)
treeb241ba1fe96cb14edbd10967c01ef48c58324c66 /lisp
parent58fbe886f57da9b450fc6f1d1f5b2fee9c1fa0fc (diff)
downloademacs-1a67b811cbad70fec1d0eaf7a9e3c66784fe6556.tar.gz
emacs-1a67b811cbad70fec1d0eaf7a9e3c66784fe6556.zip
Fix bug #14838 with slow scrolling with certain fonts.
lisp/simple.el (default-font-height): Don't call font-info if the frame's default font didn't change since the frame was created.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/simple.el13
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 533ea0a0f23..4bfc800913a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-07-13 Eli Zaretskii <eliz@gnu.org>
2
3 * simple.el (default-font-height): Don't call font-info if the
4 frame's default font didn't change since the frame was created.
5 (Bug#14838)
6
12013-07-13 Leo Liu <sdl.web@gmail.com> 72013-07-13 Leo Liu <sdl.web@gmail.com>
2 8
3 * ido.el (ido-read-file-name): Guard against non-symbol value. 9 * ido.el (ido-read-file-name): Guard against non-symbol value.
diff --git a/lisp/simple.el b/lisp/simple.el
index 9158452fd64..3e3ff485c5e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4739,10 +4739,15 @@ lines."
4739 4739
4740(defun default-font-height () 4740(defun default-font-height ()
4741 "Return the height in pixels of the current buffer's default face font." 4741 "Return the height in pixels of the current buffer's default face font."
4742 (cond 4742 (let ((default-font (face-font 'default)))
4743 ((display-multi-font-p) 4743 (cond
4744 (aref (font-info (face-font 'default)) 3)) 4744 ((and (display-multi-font-p)
4745 (t (frame-char-height)))) 4745 ;; Avoid calling font-info if the frame's default font was
4746 ;; not changed since the frame was created. That's because
4747 ;; font-info is expensive for some fonts, see bug #14838.
4748 (not (string= (frame-parameter nil 'font) default-font)))
4749 (aref (font-info default-font) 3))
4750 (t (frame-char-height)))))
4746 4751
4747(defun default-line-height () 4752(defun default-line-height ()
4748 "Return the pixel height of current buffer's default-face text line. 4753 "Return the pixel height of current buffer's default-face text line.