aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2002-07-07 23:43:25 +0000
committerMiles Bader2002-07-07 23:43:25 +0000
commit35f23bbf82bbd5e5ba34d3c478e0d9c297db9476 (patch)
treebdc5e81d1bc448d3c000b917a93ce1fe11b41aea
parented1b7d5eda0334b9560013f313b90f483c561c39 (diff)
downloademacs-35f23bbf82bbd5e5ba34d3c478e0d9c297db9476.tar.gz
emacs-35f23bbf82bbd5e5ba34d3c478e0d9c297db9476.zip
Add entries for face-attribute-relative-p, merge-face-attribute.
Describe INHERIT argument to face-attribute function.
-rw-r--r--lispref/display.texi31
1 files changed, 30 insertions, 1 deletions
diff --git a/lispref/display.texi b/lispref/display.texi
index d376feece7f..370f7f3e23c 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -1654,7 +1654,7 @@ to the corresponding values.
1654@end defun 1654@end defun
1655 1655
1656@tindex face-attribute 1656@tindex face-attribute
1657@defun face-attribute face attribute &optional frame 1657@defun face-attribute face attribute &optional frame inherit
1658This returns the value of the @var{attribute} attribute of face 1658This returns the value of the @var{attribute} attribute of face
1659@var{face} on @var{frame}. If @var{frame} is @code{nil}, 1659@var{face} on @var{frame}. If @var{frame} is @code{nil},
1660that means the selected frame (@pxref{Input Focus}). 1660that means the selected frame (@pxref{Input Focus}).
@@ -1662,6 +1662,20 @@ that means the selected frame (@pxref{Input Focus}).
1662If @var{frame} is @code{t}, the value is the default for 1662If @var{frame} is @code{t}, the value is the default for
1663@var{face} for new frames. 1663@var{face} for new frames.
1664 1664
1665If @var{inherit} is nil, only attributes directly defined by
1666@var{face} are considered, so the return value may be
1667@code{unspecified}, or a relative value. If @var{inherit} is non-nil,
1668@var{face}'s definition of @var{attribute} is merged with the faces
1669specified by its @code{:inherit} attribute; however the return value
1670may still be @code{unspecified} or relative. If @var{inherit} is a
1671face or a list of faces, then the result is further merged with that
1672face (or faces), until it becomes specified and absolute.
1673
1674To ensure that the return value is always specified and absolute, use
1675a value of @code{default} for @var{inherit}; this will resolve any
1676unspecified or relative values by merging with the @code{default} face
1677(which is always completely specified).
1678
1665For example, 1679For example,
1666 1680
1667@example 1681@example
@@ -1674,6 +1688,21 @@ For example,
1674with older Emacs versions, you can use the following functions to set 1688with older Emacs versions, you can use the following functions to set
1675and examine the face attributes which existed in those versions. 1689and examine the face attributes which existed in those versions.
1676 1690
1691@tindex face-attribute-relative-p
1692@defun face-attribute-relative-p attribute value
1693This function returns non-@code{nil} if @var{value}, when used as a
1694the value of the face attribute @var{attribute}, is relative (that is,
1695if it modifies an underlying or inherited value of @var{attribute}).
1696@end defun
1697
1698@tindex merge-face-attribute
1699@defun merge-face-attribute attribute value1 value2
1700If @var{value1} is a relative value for the face attribute
1701@var{attribute}, returns it merged with the underlying value
1702@var{value2}; otherwise, if @var{value1} is an absolute value for the
1703face a attribute @var{attribute}, returns @var{value1} unchanged.
1704@end defun
1705
1677@defun set-face-foreground face color &optional frame 1706@defun set-face-foreground face color &optional frame
1678@defunx set-face-background face color &optional frame 1707@defunx set-face-background face color &optional frame
1679These functions set the foreground (or background, respectively) color 1708These functions set the foreground (or background, respectively) color