diff options
| author | Miles Bader | 2002-07-07 23:43:25 +0000 |
|---|---|---|
| committer | Miles Bader | 2002-07-07 23:43:25 +0000 |
| commit | 35f23bbf82bbd5e5ba34d3c478e0d9c297db9476 (patch) | |
| tree | bdc5e81d1bc448d3c000b917a93ce1fe11b41aea | |
| parent | ed1b7d5eda0334b9560013f313b90f483c561c39 (diff) | |
| download | emacs-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.texi | 31 |
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 |
| 1658 | This returns the value of the @var{attribute} attribute of face | 1658 | This 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}, |
| 1660 | that means the selected frame (@pxref{Input Focus}). | 1660 | that means the selected frame (@pxref{Input Focus}). |
| @@ -1662,6 +1662,20 @@ that means the selected frame (@pxref{Input Focus}). | |||
| 1662 | If @var{frame} is @code{t}, the value is the default for | 1662 | If @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 | ||
| 1665 | If @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 | ||
| 1669 | specified by its @code{:inherit} attribute; however the return value | ||
| 1670 | may still be @code{unspecified} or relative. If @var{inherit} is a | ||
| 1671 | face or a list of faces, then the result is further merged with that | ||
| 1672 | face (or faces), until it becomes specified and absolute. | ||
| 1673 | |||
| 1674 | To ensure that the return value is always specified and absolute, use | ||
| 1675 | a value of @code{default} for @var{inherit}; this will resolve any | ||
| 1676 | unspecified or relative values by merging with the @code{default} face | ||
| 1677 | (which is always completely specified). | ||
| 1678 | |||
| 1665 | For example, | 1679 | For example, |
| 1666 | 1680 | ||
| 1667 | @example | 1681 | @example |
| @@ -1674,6 +1688,21 @@ For example, | |||
| 1674 | with older Emacs versions, you can use the following functions to set | 1688 | with older Emacs versions, you can use the following functions to set |
| 1675 | and examine the face attributes which existed in those versions. | 1689 | and 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 | ||
| 1693 | This function returns non-@code{nil} if @var{value}, when used as a | ||
| 1694 | the value of the face attribute @var{attribute}, is relative (that is, | ||
| 1695 | if 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 | ||
| 1700 | If @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 | ||
| 1703 | face 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 |
| 1679 | These functions set the foreground (or background, respectively) color | 1708 | These functions set the foreground (or background, respectively) color |