+2013-07-13 Eli Zaretskii <eliz@gnu.org>
+
+ * simple.el (default-font-height): Don't call font-info if the
+ frame's default font didn't change since the frame was created.
+ (Bug#14838)
+
2013-07-13 Leo Liu <sdl.web@gmail.com>
* ido.el (ido-read-file-name): Guard against non-symbol value.
(defun default-font-height ()
"Return the height in pixels of the current buffer's default face font."
- (cond
- ((display-multi-font-p)
- (aref (font-info (face-font 'default)) 3))
- (t (frame-char-height))))
+ (let ((default-font (face-font 'default)))
+ (cond
+ ((and (display-multi-font-p)
+ ;; Avoid calling font-info if the frame's default font was
+ ;; not changed since the frame was created. That's because
+ ;; font-info is expensive for some fonts, see bug #14838.
+ (not (string= (frame-parameter nil 'font) default-font)))
+ (aref (font-info default-font) 3))
+ (t (frame-char-height)))))
(defun default-line-height ()
"Return the pixel height of current buffer's default-face text line.