From: Lars Ingebrigtsen Date: Fri, 29 Apr 2022 13:52:21 +0000 (+0200) Subject: Simplify window-char-pixel-* code slightly X-Git-Tag: emacs-29.0.90~1931^2~215 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e065d08fa73ee128cb8373a5c246dc063bc41624;p=emacs.git Simplify window-char-pixel-* code slightly * lisp/window.el (window-char-pixel-width) (window-char-pixel-height): Simplify code slightly. --- diff --git a/lisp/window.el b/lisp/window.el index bb4d51da5f5..5ceec77bd32 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -10488,8 +10488,7 @@ If FACE is nil or omitted, the default face is used. If FACE is remapped (see `face-remapping-alist'), the function returns the information for the remapped face." (with-selected-window (window-normalize-window window t) - (let* ((face (if face face 'default)) - (info (font-info (face-font face))) + (let* ((info (font-info (face-font (or face 'default)))) (width (aref info 11))) (if (> width 0) width @@ -10503,9 +10502,7 @@ If FACE is nil or omitted, the default face is used. If FACE is remapped (see `face-remapping-alist'), the function returns the information for the remapped face." (with-selected-window (window-normalize-window window t) - (let* ((face (if face face 'default)) - (info (font-info (face-font face)))) - (aref info 3)))) + (aref (font-info (face-font (or face 'default))) 3))) (defun window-max-characters-per-line (&optional window face) "Return the number of characters that can be displayed on one line in WINDOW.