diff options
| -rw-r--r-- | doc/lispref/display.texi | 24 | ||||
| -rw-r--r-- | lisp/faces.el | 13 |
2 files changed, 21 insertions, 16 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index aa75dcf5a0a..4a895f74a5d 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -2531,16 +2531,20 @@ This function also defines @var{face} as a valid face name if it is | |||
| 2531 | not already one, and (re)calculates its attributes on existing frames. | 2531 | not already one, and (re)calculates its attributes on existing frames. |
| 2532 | 2532 | ||
| 2533 | @cindex override spec @r{(for a face)} | 2533 | @cindex override spec @r{(for a face)} |
| 2534 | The argument @var{spec-type} determines which spec to set. If it is | 2534 | The optional argument @var{spec-type} determines which spec to set. |
| 2535 | @code{nil} or @code{face-override-spec}, this function sets the | 2535 | If it is omitted or @code{nil} or @code{face-override-spec}, this |
| 2536 | @dfn{override spec}, which overrides over all other face specs on | 2536 | function sets the @dfn{override spec}, which overrides face specs on |
| 2537 | @var{face}. If it is @code{customized-face} or @code{saved-face}, | 2537 | @var{face} of all the other types mentioned below. This is useful |
| 2538 | this function sets the customized spec or the saved custom spec. If | 2538 | when calling this function outside of Custom code. If @var{spec-type} |
| 2539 | it is @code{face-defface-spec}, this function sets the default face | 2539 | is @code{customized-face} or @code{saved-face}, this function sets the |
| 2540 | spec (the same one set by @code{defface}). If it is @code{reset}, | 2540 | customized spec or the saved custom spec, respectively. If it is |
| 2541 | this function clears out all customization specs and override specs | 2541 | @code{face-defface-spec}, this function sets the default face spec |
| 2542 | from @var{face} (in this case, the value of @var{spec} is ignored). | 2542 | (the same one set by @code{defface}). If it is @code{reset}, this |
| 2543 | Any other value of @var{spec-type} is reserved for internal use. | 2543 | function clears out all customization specs and override specs from |
| 2544 | @var{face} (in this case, the value of @var{spec} is ignored). The | ||
| 2545 | effect of any other value of @var{spec-type} on the face specs is | ||
| 2546 | reserved for internal use, but the function will still define | ||
| 2547 | @var{face} itself and recalculate its attributes, as described above. | ||
| 2544 | @end defun | 2548 | @end defun |
| 2545 | 2549 | ||
| 2546 | @node Attribute Functions | 2550 | @node Attribute Functions |
diff --git a/lisp/faces.el b/lisp/faces.el index 1f9b3974c72..9a8a1344caf 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1667,7 +1667,7 @@ is given, in which case return its value instead." | |||
| 1667 | face--attributes-unspecified))) | 1667 | face--attributes-unspecified))) |
| 1668 | 1668 | ||
| 1669 | (defun face-spec-set (face spec &optional spec-type) | 1669 | (defun face-spec-set (face spec &optional spec-type) |
| 1670 | "Set the face spec SPEC for FACE. | 1670 | "Set the FACE's spec SPEC, define FACE, and recalculate its attributes. |
| 1671 | See `defface' for the format of SPEC. | 1671 | See `defface' for the format of SPEC. |
| 1672 | 1672 | ||
| 1673 | The appearance of each face is controlled by its specs (set via | 1673 | The appearance of each face is controlled by its specs (set via |
| @@ -1678,10 +1678,11 @@ This function also defines FACE as a valid face name if it is not | |||
| 1678 | already one, and (re)calculates its attributes on existing | 1678 | already one, and (re)calculates its attributes on existing |
| 1679 | frames. | 1679 | frames. |
| 1680 | 1680 | ||
| 1681 | The argument SPEC-TYPE determines which spec to set: | 1681 | The optional argument SPEC-TYPE determines which spec to set: |
| 1682 | nil or `face-override-spec' means the override spec (which is | 1682 | nil, omitted or `face-override-spec' means the override spec, |
| 1683 | usually what you want if calling this function outside of | 1683 | which overrides all the other types of spec mentioned below |
| 1684 | Custom code); | 1684 | (this is usually what you want if calling this function |
| 1685 | outside of Custom code); | ||
| 1685 | `customized-face' or `saved-face' means the customized spec or | 1686 | `customized-face' or `saved-face' means the customized spec or |
| 1686 | the saved custom spec; | 1687 | the saved custom spec; |
| 1687 | `face-defface-spec' means the default spec | 1688 | `face-defface-spec' means the default spec |
| @@ -1689,7 +1690,7 @@ The argument SPEC-TYPE determines which spec to set: | |||
| 1689 | `reset' means to ignore SPEC, but clear the `customized-face' | 1690 | `reset' means to ignore SPEC, but clear the `customized-face' |
| 1690 | and `face-override-spec' specs; | 1691 | and `face-override-spec' specs; |
| 1691 | Any other value means not to set any spec, but to run the | 1692 | Any other value means not to set any spec, but to run the |
| 1692 | function for its other effects." | 1693 | function for defining FACE and recalculating its attributes." |
| 1693 | (if (get face 'face-alias) | 1694 | (if (get face 'face-alias) |
| 1694 | (setq face (get face 'face-alias))) | 1695 | (setq face (get face 'face-alias))) |
| 1695 | ;; Save SPEC to the relevant symbol property. | 1696 | ;; Save SPEC to the relevant symbol property. |