diff options
| author | Eli Zaretskii | 2019-12-06 17:42:19 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-12-06 17:43:26 +0200 |
| commit | 30eac47981c0d0d97221d5b94fd91ada99097de4 (patch) | |
| tree | 6f27d30a4653b7d1e44afb3b3ec5914c73633eaf | |
| parent | 1171fa32ca0bc7682b9fdc93babebc4c4feed104 (diff) | |
| download | emacs-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.texi | 8 | ||||
| -rw-r--r-- | lisp/simple.el | 12 |
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 | ||
| 2894 | If the optional argument @var{frame} is specified, it returns the name | 2894 | If the optional argument @var{frame} is specified, it returns the name |
| 2895 | of the font of @var{face} for that frame. If @var{frame} is omitted or | 2895 | of 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 |
| 2897 | optional third argument @var{character} is supplied, it returns the font | 2897 | optional third argument @var{character} is supplied, it returns the font |
| 2898 | name used for @var{character}. | 2898 | name 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 |
| 3936 | This function returns the average width in pixels of the font used by | 3936 | This function returns the average width in pixels of the font used by |
| 3937 | the current buffer's default face. | 3937 | the current buffer's default face, as that face is defined for the |
| 3938 | selected frame. | ||
| 3938 | @end defun | 3939 | @end defun |
| 3939 | 3940 | ||
| 3940 | @defun default-font-height | 3941 | @defun default-font-height |
| 3941 | This function returns the height in pixels of the font used by the | 3942 | This function returns the height in pixels of the font used by the |
| 3942 | current buffer's default face. | 3943 | current buffer's default face, as that face is defined for the |
| 3944 | selected 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 | ||
| 6196 | If the default font is remapped (see `face-remapping-alist'), the | 6196 | If the default font is remapped (see `face-remapping-alist'), the |
| 6197 | function returns the height of the remapped face." | 6197 | function returns the height of the remapped face. |
| 6198 | This function uses the definition of the default face for the currently | ||
| 6199 | selected 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 | ||
| 6211 | If the default font is remapped (see `face-remapping-alist'), the | 6213 | If the default font is remapped (see `face-remapping-alist'), the |
| 6212 | function returns the width of the remapped face." | 6214 | function returns the width of the remapped face. |
| 6215 | This function uses the definition of the default face for the currently | ||
| 6216 | selected 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 | ||
| 6230 | The value includes `line-spacing', if any, defined for the buffer | 6234 | The value includes `line-spacing', if any, defined for the buffer |
| 6231 | or the frame." | 6235 | or the frame. |
| 6236 | This function uses the definition of the default face for the currently | ||
| 6237 | selected 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 |