aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-12-06 17:42:19 +0200
committerEli Zaretskii2019-12-06 17:43:26 +0200
commit30eac47981c0d0d97221d5b94fd91ada99097de4 (patch)
tree6f27d30a4653b7d1e44afb3b3ec5914c73633eaf
parent1171fa32ca0bc7682b9fdc93babebc4c4feed104 (diff)
downloademacs-30eac47981c0d0d97221d5b94fd91ada99097de4.tar.gz
emacs-30eac47981c0d0d97221d5b94fd91ada99097de4.zip
Clarify documentation of functions that use the default face
* lisp/simple.el (default-font-height, default-font-width) (default-line-height): Say in the doc strings that the default face these functions use is for the currently selected frame. * doc/lispref/display.texi (Attribute Functions) (Low-Level Font): Document more clearly the dependence of the results of 'face-font', 'default-font-width', and 'default-font-height' on the frame's definition of the default face.
-rw-r--r--doc/lispref/display.texi8
-rw-r--r--lisp/simple.el12
2 files changed, 14 insertions, 6 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 1f7cc93c9c4..fa81b2e9538 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2893,7 +2893,7 @@ This function returns the name of the font of face @var{face}.
2893 2893
2894If the optional argument @var{frame} is specified, it returns the name 2894If the optional argument @var{frame} is specified, it returns the name
2895of the font of @var{face} for that frame. If @var{frame} is omitted or 2895of the font of @var{face} for that frame. If @var{frame} is omitted or
2896@code{nil}, the selected frame is used. And, in this case, if the 2896@code{nil}, the selected frame is used. In the latter case, if the
2897optional third argument @var{character} is supplied, it returns the font 2897optional third argument @var{character} is supplied, it returns the font
2898name used for @var{character}. 2898name used for @var{character}.
2899@end defun 2899@end defun
@@ -3934,12 +3934,14 @@ was remapped. @xref{Face Remapping}.
3934 3934
3935@defun default-font-width 3935@defun default-font-width
3936This function returns the average width in pixels of the font used by 3936This function returns the average width in pixels of the font used by
3937the current buffer's default face. 3937the current buffer's default face, as that face is defined for the
3938selected frame.
3938@end defun 3939@end defun
3939 3940
3940@defun default-font-height 3941@defun default-font-height
3941This function returns the height in pixels of the font used by the 3942This function returns the height in pixels of the font used by the
3942current buffer's default face. 3943current buffer's default face, as that face is defined for the
3944selected frame.
3943@end defun 3945@end defun
3944 3946
3945@defun window-font-width &optional window face 3947@defun window-font-width &optional window face
diff --git a/lisp/simple.el b/lisp/simple.el
index 5e4cd8f5bc0..67ddab3d343 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6194,7 +6194,9 @@ lines."
6194 "Return the height in pixels of the current buffer's default face font. 6194 "Return the height in pixels of the current buffer's default face font.
6195 6195
6196If the default font is remapped (see `face-remapping-alist'), the 6196If the default font is remapped (see `face-remapping-alist'), the
6197function returns the height of the remapped face." 6197function returns the height of the remapped face.
6198This function uses the definition of the default face for the currently
6199selected frame."
6198 (let ((default-font (face-font 'default))) 6200 (let ((default-font (face-font 'default)))
6199 (cond 6201 (cond
6200 ((and (display-multi-font-p) 6202 ((and (display-multi-font-p)
@@ -6209,7 +6211,9 @@ function returns the height of the remapped face."
6209 "Return the width in pixels of the current buffer's default face font. 6211 "Return the width in pixels of the current buffer's default face font.
6210 6212
6211If the default font is remapped (see `face-remapping-alist'), the 6213If the default font is remapped (see `face-remapping-alist'), the
6212function returns the width of the remapped face." 6214function returns the width of the remapped face.
6215This function uses the definition of the default face for the currently
6216selected frame."
6213 (let ((default-font (face-font 'default))) 6217 (let ((default-font (face-font 'default)))
6214 (cond 6218 (cond
6215 ((and (display-multi-font-p) 6219 ((and (display-multi-font-p)
@@ -6228,7 +6232,9 @@ function returns the width of the remapped face."
6228 "Return the pixel height of current buffer's default-face text line. 6232 "Return the pixel height of current buffer's default-face text line.
6229 6233
6230The value includes `line-spacing', if any, defined for the buffer 6234The value includes `line-spacing', if any, defined for the buffer
6231or the frame." 6235or the frame.
6236This function uses the definition of the default face for the currently
6237selected frame."
6232 (let ((dfh (default-font-height)) 6238 (let ((dfh (default-font-height))
6233 (lsp (if (display-graphic-p) 6239 (lsp (if (display-graphic-p)
6234 (or line-spacing 6240 (or line-spacing