aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/display.texi24
-rw-r--r--lisp/faces.el13
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
2531not already one, and (re)calculates its attributes on existing frames. 2531not 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)}
2534The argument @var{spec-type} determines which spec to set. If it is 2534The optional argument @var{spec-type} determines which spec to set.
2535@code{nil} or @code{face-override-spec}, this function sets the 2535If it is omitted or @code{nil} or @code{face-override-spec}, this
2536@dfn{override spec}, which overrides over all other face specs on 2536function 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
2538this function sets the customized spec or the saved custom spec. If 2538when calling this function outside of Custom code. If @var{spec-type}
2539it is @code{face-defface-spec}, this function sets the default face 2539is @code{customized-face} or @code{saved-face}, this function sets the
2540spec (the same one set by @code{defface}). If it is @code{reset}, 2540customized spec or the saved custom spec, respectively. If it is
2541this function clears out all customization specs and override specs 2541@code{face-defface-spec}, this function sets the default face spec
2542from @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
2543Any other value of @var{spec-type} is reserved for internal use. 2543function clears out all customization specs and override specs from
2544@var{face} (in this case, the value of @var{spec} is ignored). The
2545effect of any other value of @var{spec-type} on the face specs is
2546reserved 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.
1671See `defface' for the format of SPEC. 1671See `defface' for the format of SPEC.
1672 1672
1673The appearance of each face is controlled by its specs (set via 1673The 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
1678already one, and (re)calculates its attributes on existing 1678already one, and (re)calculates its attributes on existing
1679frames. 1679frames.
1680 1680
1681The argument SPEC-TYPE determines which spec to set: 1681The 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;
1691Any other value means not to set any spec, but to run the 1692Any other value means not to set any spec, but to run the
1692function for its other effects." 1693function 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.