From 4edb174e38b3fb61ea95f11a938e648fd789a2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Thu, 29 Aug 2019 20:06:47 +0200 Subject: [PATCH] Correct default-font-{height,width}, default-line-height doc strings * doc/lispref/display.texi (Low-Level Font): Correct doc strings of default-font-height and default-font-width. They return information for the selected frame, not the current buffer. * lisp/simple.el (default-font-height, default-font-width, default-line-height): Correct doc strings. --- doc/lispref/display.texi | 4 ++-- lisp/simple.el | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 1f7cc93c9c..6704c714e2 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3934,12 +3934,12 @@ Low-Level Font @defun default-font-width This function returns the average width in pixels of the font used by -the current buffer's default face. +the selected frame's default face. @end defun @defun default-font-height This function returns the height in pixels of the font used by the -current buffer's default face. +selected frame's default face. @end defun @defun window-font-width &optional window face diff --git a/lisp/simple.el b/lisp/simple.el index 47ce0364d1..28a416fa2c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6183,7 +6183,7 @@ line-move-visual (declare-function font-info "font.c" (name &optional frame)) (defun default-font-height () - "Return the height in pixels of the current buffer's default face font. + "Return the height in pixels of the selected frame's default face font. If the default font is remapped (see `face-remapping-alist'), the function returns the height of the remapped face." @@ -6198,7 +6198,7 @@ default-font-height (t (frame-char-height))))) (defun default-font-width () - "Return the width in pixels of the current buffer's default face font. + "Return the width in pixels of the selected frame's default face font. If the default font is remapped (see `face-remapping-alist'), the function returns the width of the remapped face." @@ -6217,9 +6217,9 @@ default-font-width (t (frame-char-width))))) (defun default-line-height () - "Return the pixel height of current buffer's default-face text line. + "Return the pixel height of the selected frame's default-face text line. -The value includes `line-spacing', if any, defined for the buffer +The value includes `line-spacing', if any, defined for the current buffer or the frame." (let ((dfh (default-font-height)) (lsp (if (display-graphic-p) -- 2.24.0