From e065d08fa73ee128cb8373a5c246dc063bc41624 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 29 Apr 2022 15:52:21 +0200 Subject: [PATCH] Simplify window-char-pixel-* code slightly * lisp/window.el (window-char-pixel-width) (window-char-pixel-height): Simplify code slightly. --- lisp/window.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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. -- 2.39.2