diff options
| author | Eli Zaretskii | 2022-09-01 11:42:33 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-09-01 11:42:33 +0300 |
| commit | 89695bce3e4f3716cdb2d322cf3efd0fe5454bec (patch) | |
| tree | e7e801e386edd343efdbe92e992c05376386d626 | |
| parent | f44c4e49b72398ba0433637b01f2c431d0ac7f2b (diff) | |
| download | emacs-89695bce3e4f3716cdb2d322cf3efd0fe5454bec.tar.gz emacs-89695bce3e4f3716cdb2d322cf3efd0fe5454bec.zip | |
Clarify the doc string of 'set-face-attribute'
* lisp/faces.el (set-face-attribute): Clarify the issue with
resetting attribute values to 'unspecified' for future frames.
(Bug#57499)
| -rw-r--r-- | lisp/faces.el | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 59287ffbbd1..ba33bec70da 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -668,21 +668,28 @@ If FACE is a face-alias, get the documentation for the target face." | |||
| 668 | 668 | ||
| 669 | (defun set-face-attribute (face frame &rest args) | 669 | (defun set-face-attribute (face frame &rest args) |
| 670 | "Set attributes of FACE on FRAME from ARGS. | 670 | "Set attributes of FACE on FRAME from ARGS. |
| 671 | This function overrides the face attributes specified by FACE's | 671 | This function overrides the face attributes specified by FACE's face spec. |
| 672 | face spec. It is mostly intended for internal use only. | 672 | It is mostly intended for internal use. |
| 673 | 673 | ||
| 674 | If FRAME is nil, set the attributes for all existing frames, as | 674 | If FRAME is a frame, set the FACE's attributes only for that frame. If |
| 675 | well as the default for new frames. If FRAME is t, change the | 675 | FRAME is nil, set attribute values for all existing frames, as well as |
| 676 | default for new frames only. As an exception, to reset the value | 676 | the default for new frames. If FRAME is t, change the default values |
| 677 | of some attribute to `unspecified' in a way that overrides the | 677 | of attributes for new frames. |
| 678 | non-`unspecified' value defined by the face's spec in `defface', | 678 | |
| 679 | for new frames, you must explicitly call this function with FRAME | 679 | ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a valid face |
| 680 | set to t and the attribute's value set to `unspecified'; just | 680 | attribute name and VALUE must be a value that is valid for ATTRIBUTE, |
| 681 | using FRAME of nil will not affect new frames in this case. | 681 | as described below for each attribute. |
| 682 | 682 | ||
| 683 | ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a | 683 | In addition to the attribute values listed below, all attributes can |
| 684 | valid face attribute name. All attributes can be set to | 684 | also be set to the special value `unspecified', which means the face |
| 685 | `unspecified'; this fact is not further mentioned below. | 685 | doesn't by itself specify a value for the attribute. |
| 686 | |||
| 687 | When a new frame is created, attribute values in the FACE's `defface' | ||
| 688 | spec normally override the `unspecified' values in the FACE's | ||
| 689 | default attributes. To avoid that, i.e. to cause ATTRIBUTE's value | ||
| 690 | be reset to `unspecified' when creating new frames, disregarding | ||
| 691 | what the FACE's face spec says, call this function with FRAME set to | ||
| 692 | t and the ATTRIBUTE's value set to `unspecified'. | ||
| 686 | 693 | ||
| 687 | The following attributes are recognized: | 694 | The following attributes are recognized: |
| 688 | 695 | ||