diff options
| author | Chong Yidong | 2009-01-08 01:19:44 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-01-08 01:19:44 +0000 |
| commit | 42a2a154142f296d056132c982f1f41ba265c847 (patch) | |
| tree | d4e530566a4e9da6eb9d057f088e33b0a4322de0 | |
| parent | e3d3799a7134dbbe9cb05f35499c3634c339b1f5 (diff) | |
| download | emacs-42a2a154142f296d056132c982f1f41ba265c847.tar.gz emacs-42a2a154142f296d056132c982f1f41ba265c847.zip | |
(Faces): Don't discuss face id here. facep does
not return t.
(Defining Faces): Minor clarification.
(Face Attributes): Rearrange items to match docstring of
set-face-attribute. Add :foundry attribute. Document new role of
:font attribute. Texinfo usage fix.
(Attribute Functions): Copyedits.
(Face Functions): Note that face number is seldom used.
| -rw-r--r-- | doc/lispref/display.texi | 291 |
1 files changed, 139 insertions, 152 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 25b29b2ec01..4c23c04a164 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -1760,26 +1760,26 @@ height. | |||
| 1760 | @section Faces | 1760 | @section Faces |
| 1761 | @cindex faces | 1761 | @cindex faces |
| 1762 | 1762 | ||
| 1763 | A @dfn{face} is a named collection of graphical attributes: font | 1763 | A @dfn{face} is a collection of graphical attributes for displaying |
| 1764 | family, foreground color, background color, optional underlining, and | 1764 | text: font family, foreground color, background color, optional |
| 1765 | many others. Faces are used in Emacs to control the style of display of | 1765 | underlining, and so on. Faces control how buffer text is displayed, |
| 1766 | particular parts of the text or the frame. @xref{Standard Faces,,, | 1766 | and how some parts of the frame, such as the mode-line, are displayed. |
| 1767 | emacs, The GNU Emacs Manual}, for the list of faces Emacs normally | 1767 | @xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of |
| 1768 | comes with. | 1768 | faces Emacs normally comes with. |
| 1769 | 1769 | ||
| 1770 | @cindex face id | 1770 | @cindex face id |
| 1771 | Each face has its own @dfn{face number}, which distinguishes faces at | 1771 | For most purposes, you refer to a face in Lisp programs using its |
| 1772 | low levels within Emacs. However, for most purposes, you refer to | 1772 | @dfn{face name}. This is either a string or (equivalently) a Lisp |
| 1773 | faces in Lisp programs by the symbols that name them. | 1773 | symbol whose name is equal to that string. |
| 1774 | 1774 | ||
| 1775 | @defun facep object | 1775 | @defun facep object |
| 1776 | This function returns @code{t} if @var{object} is a face name string | 1776 | This function returns a non-@code{nil} value if @var{object} is a Lisp |
| 1777 | or symbol. It returns @code{nil} otherwise. | 1777 | symbol or string that names a face. Otherwise, it returns @code{nil}. |
| 1778 | @end defun | 1778 | @end defun |
| 1779 | 1779 | ||
| 1780 | Each face name is meaningful for all frames, and by default it has the | 1780 | Each face name is meaningful for all frames, and by default it has |
| 1781 | same meaning in all frames. But you can arrange to give a particular | 1781 | the same meaning in all frames. But you can arrange to give a |
| 1782 | face name a special meaning in one frame if you wish. | 1782 | particular face name a special meaning in one frame if you wish. |
| 1783 | 1783 | ||
| 1784 | @menu | 1784 | @menu |
| 1785 | * Defining Faces:: How to define a face with @code{defface}. | 1785 | * Defining Faces:: How to define a face with @code{defface}. |
| @@ -1809,12 +1809,12 @@ majority of cases, this is not necessary, and simply using faces | |||
| 1809 | directly is preferable. | 1809 | directly is preferable. |
| 1810 | 1810 | ||
| 1811 | @defmac defface face spec doc [keyword value]@dots{} | 1811 | @defmac defface face spec doc [keyword value]@dots{} |
| 1812 | This declares @var{face} as a customizable face that defaults | 1812 | This declares @var{face} as a customizable face whose default |
| 1813 | according to @var{spec}. You should not quote the symbol @var{face}, | 1813 | attributes are given by @var{spec}. You should not quote the symbol |
| 1814 | and it should not end in @samp{-face} (that would be redundant). The | 1814 | @var{face}, and it should not end in @samp{-face} (that would be |
| 1815 | argument @var{doc} specifies the face documentation. The keywords you | 1815 | redundant). The argument @var{doc} specifies the face documentation. |
| 1816 | can use in @code{defface} are the same as in @code{defgroup} and | 1816 | The keywords you can use in @code{defface} are the same as in |
| 1817 | @code{defcustom} (@pxref{Common Keywords}). | 1817 | @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). |
| 1818 | 1818 | ||
| 1819 | When @code{defface} executes, it defines the face according to | 1819 | When @code{defface} executes, it defines the face according to |
| 1820 | @var{spec}, then uses any customizations that were read from the | 1820 | @var{spec}, then uses any customizations that were read from the |
| @@ -1882,10 +1882,9 @@ should support. This matches a frame if its | |||
| 1882 | 1882 | ||
| 1883 | @item supports | 1883 | @item supports |
| 1884 | Whether or not the frame can display the face attributes given in | 1884 | Whether or not the frame can display the face attributes given in |
| 1885 | @var{value}@dots{} (@pxref{Face Attributes}). See the documentation | 1885 | @var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face |
| 1886 | for the function @code{display-supports-face-attributes-p} for more | 1886 | Attribute Testing}, for more information on exactly how this testing |
| 1887 | information on exactly how this testing is done. @xref{Display Face | 1887 | is done. |
| 1888 | Attribute Testing}. | ||
| 1889 | @end table | 1888 | @end table |
| 1890 | 1889 | ||
| 1891 | If an element of @var{display} specifies more than one @var{value} for a | 1890 | If an element of @var{display} specifies more than one @var{value} for a |
| @@ -1923,11 +1922,13 @@ frame must match one of the @var{value}s specified for it in | |||
| 1923 | @end example | 1922 | @end example |
| 1924 | 1923 | ||
| 1925 | Internally, @code{defface} uses the symbol property | 1924 | Internally, @code{defface} uses the symbol property |
| 1926 | @code{face-defface-spec} to record the face attributes specified in | 1925 | @code{face-defface-spec} to record the specified face attributes. The |
| 1927 | @code{defface}, @code{saved-face} for the attributes saved by the user | 1926 | attributes saved by the user with the customization buffer are |
| 1928 | with the customization buffer, @code{customized-face} for the | 1927 | recorded in the symbol property @code{saved-face}; the attributes |
| 1929 | attributes customized by the user for the current session, but not | 1928 | customized by the user for the current session, but not saved, are |
| 1930 | saved, and @code{face-documentation} for the documentation string. | 1929 | recorded in the symbol property @code{customized-face}. The |
| 1930 | documentation string is recorded in the symbol property | ||
| 1931 | @code{face-documentation}. | ||
| 1931 | 1932 | ||
| 1932 | @defopt frame-background-mode | 1933 | @defopt frame-background-mode |
| 1933 | This option, if non-@code{nil}, specifies the background type to use for | 1934 | This option, if non-@code{nil}, specifies the background type to use for |
| @@ -1942,92 +1943,74 @@ as if they had a light background. | |||
| 1942 | @cindex face attributes | 1943 | @cindex face attributes |
| 1943 | 1944 | ||
| 1944 | The effect of using a face is determined by a fixed set of @dfn{face | 1945 | The effect of using a face is determined by a fixed set of @dfn{face |
| 1945 | attributes}. This table lists all the face attributes, and what they | 1946 | attributes}. This table lists all the face attributes, their possible |
| 1946 | mean. You can specify more than one face for a given piece of text; | 1947 | values, and their effects. You can specify more than one face for a |
| 1947 | Emacs merges the attributes of all the faces to determine how to | 1948 | given piece of text; Emacs merges the attributes of all the faces to |
| 1948 | display the text. @xref{Displaying Faces}. | 1949 | determine how to display the text. @xref{Displaying Faces}. |
| 1949 | 1950 | ||
| 1950 | Any attribute in a face can have the value @code{unspecified}. This | 1951 | In addition to the values given below, each face attribute can also |
| 1951 | means the face doesn't specify that attribute. In face merging, when | 1952 | have the value @code{unspecified}. This special value means the face |
| 1952 | the first face fails to specify a particular attribute, that means the | 1953 | doesn't specify that attribute. In face merging, when the first face |
| 1953 | next face gets a chance. However, the @code{default} face must | 1954 | fails to specify a particular attribute, the next face gets a chance. |
| 1954 | specify all attributes. | 1955 | However, the @code{default} face must specify all attributes. |
| 1955 | 1956 | ||
| 1956 | Some of these font attributes are meaningful only on certain kinds of | 1957 | Some of these font attributes are meaningful only on certain kinds |
| 1957 | displays---if your display cannot handle a certain attribute, the | 1958 | of displays. If your display cannot handle a certain attribute, the |
| 1958 | attribute is ignored. (The attributes @code{:family}, @code{:width}, | 1959 | attribute is ignored. |
| 1959 | @code{:height}, @code{:weight}, and @code{:slant} correspond to parts of | ||
| 1960 | an X Logical Font Descriptor.) | ||
| 1961 | 1960 | ||
| 1962 | @table @code | 1961 | @table @code |
| 1963 | @item :family | 1962 | @item :family |
| 1964 | Font family name, or fontset name (@pxref{Fontsets}). If you specify a | 1963 | Font family name (@pxref{Font Lookup}), or fontset name |
| 1965 | font family name, the wild-card characters @samp{*} and @samp{?} are | 1964 | (@pxref{Fontsets}). If you specify a font family name, the wild-card |
| 1966 | allowed. | 1965 | characters @samp{*} and @samp{?} are allowed. @xref{Font Lookup}. |
| 1966 | |||
| 1967 | @item :foundry | ||
| 1968 | The @dfn{font foundry} in which the font family specified by the | ||
| 1969 | @code{:family} attribute is located. The wild-card characters | ||
| 1970 | @samp{*} and @samp{?} are allowed. @xref{Font Lookup}. | ||
| 1967 | 1971 | ||
| 1968 | @item :width | 1972 | @item :width |
| 1969 | Relative proportionate width, also known as the character set width or | 1973 | Relative proportionate character width, also known as the character |
| 1970 | set width. This should be one of the symbols @code{ultra-condensed}, | 1974 | set width. This should be one of the symbols @code{ultra-condensed}, |
| 1971 | @code{extra-condensed}, @code{condensed}, @code{semi-condensed}, | 1975 | @code{extra-condensed}, @code{condensed}, @code{semi-condensed}, |
| 1972 | @code{normal}, @code{semi-expanded}, @code{expanded}, | 1976 | @code{normal}, @code{semi-expanded}, @code{expanded}, |
| 1973 | @code{extra-expanded}, or @code{ultra-expanded}. | 1977 | @code{extra-expanded}, or @code{ultra-expanded}. |
| 1974 | 1978 | ||
| 1975 | @item :height | 1979 | @item :height |
| 1976 | Either the font height, an integer in units of 1/10 point, a floating | 1980 | Font height---either an integer in units of 1/10 point, or a floating |
| 1977 | point number specifying the amount by which to scale the height of any | 1981 | point number specifying the amount by which to scale the height of any |
| 1978 | underlying face, or a function, which is called with the old height | 1982 | underlying face, or a function that is called with one argument (the |
| 1979 | (from the underlying face), and should return the new height. | 1983 | height of the underlying face) and returns the height of the new face. |
| 1984 | If the function is passed an integer argument, it must return an | ||
| 1985 | integer. | ||
| 1986 | |||
| 1987 | The height of the default face must be specified using an integer; | ||
| 1988 | floating point and function values are not allowed. | ||
| 1980 | 1989 | ||
| 1981 | @item :weight | 1990 | @item :weight |
| 1982 | Font weight---a symbol from this series (from most dense to most faint): | 1991 | Font weight---one of the symbols (from densest to faintest) |
| 1983 | @code{ultra-bold}, @code{extra-bold}, @code{bold}, @code{semi-bold}, | 1992 | @code{ultra-bold}, @code{extra-bold}, @code{bold}, @code{semi-bold}, |
| 1984 | @code{normal}, @code{semi-light}, @code{light}, @code{extra-light}, | 1993 | @code{normal}, @code{semi-light}, @code{light}, @code{extra-light}, or |
| 1985 | or @code{ultra-light}. | 1994 | @code{ultra-light}. On text-only terminals that support |
| 1986 | 1995 | variable-brightness text, any weight greater than normal is displayed | |
| 1987 | On a text-only terminal, any weight greater than normal is displayed as | 1996 | as extra bright, and any weight less than normal is displayed as |
| 1988 | extra bright, and any weight less than normal is displayed as | 1997 | half-bright. |
| 1989 | half-bright (provided the terminal supports the feature). | ||
| 1990 | 1998 | ||
| 1991 | @item :slant | 1999 | @item :slant |
| 1992 | Font slant---one of the symbols @code{italic}, @code{oblique}, @code{normal}, | 2000 | Font slant---one of the symbols @code{italic}, @code{oblique}, |
| 1993 | @code{reverse-italic}, or @code{reverse-oblique}. | 2001 | @code{normal}, @code{reverse-italic}, or @code{reverse-oblique}. On |
| 1994 | 2002 | text-only terminals that support variable-brightness text, slanted | |
| 1995 | On a text-only terminal, slanted text is displayed as half-bright, if | 2003 | text is displayed as half-bright. |
| 1996 | the terminal supports the feature. | ||
| 1997 | 2004 | ||
| 1998 | @item :foreground | 2005 | @item :foreground |
| 1999 | Foreground color, a string. The value can be a system-defined color | 2006 | Foreground color, a string. The value can be a system-defined color |
| 2000 | name, or a hexadecimal color specification of the form | 2007 | name, or a hexadecimal color specification. @xref{Color Names}. On |
| 2001 | @samp{#@var{rr}@var{gg}@var{bb}}. (@samp{#000000} is black, | 2008 | black-and-white displays, certain shades of gray are implemented by |
| 2002 | @samp{#ff0000} is red, @samp{#00ff00} is green, @samp{#0000ff} is | 2009 | stipple patterns. |
| 2003 | blue, and @samp{#ffffff} is white.) | ||
| 2004 | 2010 | ||
| 2005 | @item :background | 2011 | @item :background |
| 2006 | Background color, a string, like the foreground color. | 2012 | Background color, a string. The value can be a system-defined color |
| 2007 | 2013 | name, or a hexadecimal color specification. @xref{Color Names}. | |
| 2008 | @item :inverse-video | ||
| 2009 | Whether or not characters should be displayed in inverse video. The | ||
| 2010 | value should be @code{t} (yes) or @code{nil} (no). | ||
| 2011 | |||
| 2012 | @item :stipple | ||
| 2013 | The background stipple, a bitmap. | ||
| 2014 | |||
| 2015 | The value can be a string; that should be the name of a file containing | ||
| 2016 | external-format X bitmap data. The file is found in the directories | ||
| 2017 | listed in the variable @code{x-bitmap-file-path}. | ||
| 2018 | |||
| 2019 | Alternatively, the value can specify the bitmap directly, with a list | ||
| 2020 | of the form @code{(@var{width} @var{height} @var{data})}. Here, | ||
| 2021 | @var{width} and @var{height} specify the size in pixels, and | ||
| 2022 | @var{data} is a string containing the raw bits of the bitmap, row by | ||
| 2023 | row. Each row occupies @math{(@var{width} + 7) / 8} consecutive bytes | ||
| 2024 | in the string (which should be a unibyte string for best results). | ||
| 2025 | This means that each row always occupies at least one whole byte. | ||
| 2026 | |||
| 2027 | If the value is @code{nil}, that means use no stipple pattern. | ||
| 2028 | |||
| 2029 | Normally you do not need to set the stipple attribute, because it is | ||
| 2030 | used automatically to handle certain shades of gray. | ||
| 2031 | 2014 | ||
| 2032 | @item :underline | 2015 | @item :underline |
| 2033 | Whether or not characters should be underlined, and in what color. If | 2016 | Whether or not characters should be underlined, and in what color. If |
| @@ -2043,20 +2026,10 @@ The value is used like that of @code{:underline}. | |||
| 2043 | Whether or not characters should be strike-through, and in what | 2026 | Whether or not characters should be strike-through, and in what |
| 2044 | color. The value is used like that of @code{:underline}. | 2027 | color. The value is used like that of @code{:underline}. |
| 2045 | 2028 | ||
| 2046 | @item :inherit | ||
| 2047 | The name of a face from which to inherit attributes, or a list of face | ||
| 2048 | names. Attributes from inherited faces are merged into the face like an | ||
| 2049 | underlying face would be, with higher priority than underlying faces. | ||
| 2050 | If a list of faces is used, attributes from faces earlier in the list | ||
| 2051 | override those from later faces. | ||
| 2052 | |||
| 2053 | @item :box | 2029 | @item :box |
| 2054 | Whether or not a box should be drawn around characters, its color, the | 2030 | Whether or not a box should be drawn around characters, its color, the |
| 2055 | width of the box lines, and 3D appearance. | 2031 | width of the box lines, and 3D appearance. Here are the possible |
| 2056 | @end table | 2032 | values of the @code{:box} attribute, and what they mean: |
| 2057 | |||
| 2058 | Here are the possible values of the @code{:box} attribute, and what | ||
| 2059 | they mean: | ||
| 2060 | 2033 | ||
| 2061 | @table @asis | 2034 | @table @asis |
| 2062 | @item @code{nil} | 2035 | @item @code{nil} |
| @@ -2083,43 +2056,63 @@ that is being pressed. If it is @code{nil} or omitted, a plain 2D box | |||
| 2083 | is used. | 2056 | is used. |
| 2084 | @end table | 2057 | @end table |
| 2085 | 2058 | ||
| 2086 | In older versions of Emacs, before @code{:family}, @code{:height}, | 2059 | @item :inverse-video |
| 2087 | @code{:width}, @code{:weight}, and @code{:slant} existed, these | 2060 | Whether or not characters should be displayed in inverse video. The |
| 2088 | attributes were used to specify the type face. They are now | 2061 | value should be @code{t} (yes) or @code{nil} (no). |
| 2089 | semi-obsolete, but they still work: | ||
| 2090 | |||
| 2091 | @table @code | ||
| 2092 | @item :font | ||
| 2093 | This attribute specifies the font name. | ||
| 2094 | 2062 | ||
| 2095 | @item :bold | 2063 | @item :stipple |
| 2096 | A non-@code{nil} value specifies a bold font. | 2064 | The background stipple, a bitmap. |
| 2097 | 2065 | ||
| 2098 | @item :italic | 2066 | The value can be a string; that should be the name of a file containing |
| 2099 | A non-@code{nil} value specifies an italic font. | 2067 | external-format X bitmap data. The file is found in the directories |
| 2100 | @end table | 2068 | listed in the variable @code{x-bitmap-file-path}. |
| 2101 | 2069 | ||
| 2102 | For compatibility, you can still set these ``attributes,'' even | 2070 | Alternatively, the value can specify the bitmap directly, with a list |
| 2103 | though they are not real face attributes. Here is what that does: | 2071 | of the form @code{(@var{width} @var{height} @var{data})}. Here, |
| 2072 | @var{width} and @var{height} specify the size in pixels, and | ||
| 2073 | @var{data} is a string containing the raw bits of the bitmap, row by | ||
| 2074 | row. Each row occupies @math{(@var{width} + 7) / 8} consecutive bytes | ||
| 2075 | in the string (which should be a unibyte string for best results). | ||
| 2076 | This means that each row always occupies at least one whole byte. | ||
| 2104 | 2077 | ||
| 2105 | @table @code | 2078 | If the value is @code{nil}, that means use no stipple pattern. |
| 2106 | @item :font | ||
| 2107 | You can specify an X font name as the ``value'' of this ``attribute''; | ||
| 2108 | that sets the @code{:family}, @code{:width}, @code{:height}, | ||
| 2109 | @code{:weight}, and @code{:slant} attributes according to the font name. | ||
| 2110 | 2079 | ||
| 2111 | If the value is a pattern with wildcards, the first font that matches | 2080 | Normally you do not need to set the stipple attribute, because it is |
| 2112 | the pattern is used to set these attributes. | 2081 | used automatically to handle certain shades of gray. |
| 2113 | 2082 | ||
| 2114 | @item :bold | 2083 | @item :font |
| 2115 | A non-@code{nil} makes the face bold; @code{nil} makes it normal. | 2084 | The font used to display the face. Its value should be a font object |
| 2116 | This actually works by setting the @code{:weight} attribute. | 2085 | (@pxref{Font Lookup}). |
| 2086 | |||
| 2087 | When specifying this attribute using @code{set-face-attribute} | ||
| 2088 | (@pxref{Attribute Functions}), you may supply a font spec, a font | ||
| 2089 | entity, or a string. Emacs converts such values to an appropriate | ||
| 2090 | font object, and stores that font object internally. If you specify a | ||
| 2091 | string, the contents of the string should be an XLFD font name | ||
| 2092 | (@pxref{Font X,, Font Specification Options, emacs, The GNU Emacs | ||
| 2093 | Manual}); if the XLFD contains wildcards, Emacs chooses the first font | ||
| 2094 | matching those wildcards. Specifying this attribute also changes the | ||
| 2095 | values of the @code{:family}, @code{:foundry}, @code{:width}, | ||
| 2096 | @code{:height}, @code{:weight}, and @code{:slant} attributes. | ||
| 2117 | 2097 | ||
| 2118 | @item :italic | 2098 | @item :inherit |
| 2119 | A non-@code{nil} makes the face italic; @code{nil} makes it normal. | 2099 | The name of a face from which to inherit attributes, or a list of face |
| 2120 | This actually works by setting the @code{:slant} attribute. | 2100 | names. Attributes from inherited faces are merged into the face like |
| 2101 | an underlying face would be, with higher priority than underlying | ||
| 2102 | faces. If a list of faces is used, attributes from faces earlier in | ||
| 2103 | the list override those from later faces. | ||
| 2121 | @end table | 2104 | @end table |
| 2122 | 2105 | ||
| 2106 | For compatibility with Emacs 20, you can also specify values for two | ||
| 2107 | ``fake'' face attributes: @code{:bold} and @code{:italic}. Their | ||
| 2108 | values must be either @code{t} or @code{nil}; a value of | ||
| 2109 | @code{unspecified} is not allowed. Setting @code{:bold} to @code{t} | ||
| 2110 | is equivalent to setting the @code{:weight} attribute to @code{bold}, | ||
| 2111 | and setting it to @code{nil} is equivalent to setting @code{:weight} | ||
| 2112 | to @code{normal}. Setting @code{:italic} to @code{t} is equivalent to | ||
| 2113 | setting the @code{:slant} attribute to @code{italic}, and setting it | ||
| 2114 | to @code{nil} is equivalent to setting @code{:slant} to @code{normal}. | ||
| 2115 | |||
| 2123 | @defvar x-bitmap-file-path | 2116 | @defvar x-bitmap-file-path |
| 2124 | This variable specifies a list of directories for searching | 2117 | This variable specifies a list of directories for searching |
| 2125 | for bitmap files, for the @code{:stipple} attribute. | 2118 | for bitmap files, for the @code{:stipple} attribute. |
| @@ -2138,7 +2131,7 @@ suitable for use with @code{:stipple} (see above). It returns | |||
| 2138 | attributes of an existing face. | 2131 | attributes of an existing face. |
| 2139 | 2132 | ||
| 2140 | @defun set-face-attribute face frame &rest arguments | 2133 | @defun set-face-attribute face frame &rest arguments |
| 2141 | This function sets one or more attributes of face @var{face} for frame | 2134 | This function sets one or more attributes of @var{face} for |
| 2142 | @var{frame}. The attributes you specify this way override whatever | 2135 | @var{frame}. The attributes you specify this way override whatever |
| 2143 | the @code{defface} says. | 2136 | the @code{defface} says. |
| 2144 | 2137 | ||
| @@ -2167,9 +2160,9 @@ all existing frames, and the default for new frames. | |||
| 2167 | @end defun | 2160 | @end defun |
| 2168 | 2161 | ||
| 2169 | @defun face-attribute face attribute &optional frame inherit | 2162 | @defun face-attribute face attribute &optional frame inherit |
| 2170 | This returns the value of the @var{attribute} attribute of face | 2163 | This returns the value of the @var{attribute} attribute of @var{face} |
| 2171 | @var{face} on @var{frame}. If @var{frame} is @code{nil}, | 2164 | on @var{frame}. If @var{frame} is @code{nil}, that means the selected |
| 2172 | that means the selected frame (@pxref{Input Focus}). | 2165 | frame (@pxref{Input Focus}). |
| 2173 | 2166 | ||
| 2174 | If @var{frame} is @code{t}, this returns whatever new-frames default | 2167 | If @var{frame} is @code{t}, this returns whatever new-frames default |
| 2175 | value you previously specified with @code{set-face-attribute} for the | 2168 | value you previously specified with @code{set-face-attribute} for the |
| @@ -2233,30 +2226,22 @@ If @var{value1} is a relative value for the face attribute | |||
| 2233 | face attribute @var{attribute}, returns @var{value1} unchanged. | 2226 | face attribute @var{attribute}, returns @var{value1} unchanged. |
| 2234 | @end defun | 2227 | @end defun |
| 2235 | 2228 | ||
| 2236 | The functions above did not exist before Emacs 21. For compatibility | 2229 | The following functions provide compatibility with Emacs 20 and |
| 2237 | with older Emacs versions, you can use the following functions to set | 2230 | below. They use values of @code{t} and @code{nil} for @var{frame} |
| 2238 | and examine the face attributes which existed in those versions. | ||
| 2239 | They use values of @code{t} and @code{nil} for @var{frame} | ||
| 2240 | just like @code{set-face-attribute} and @code{face-attribute}. | 2231 | just like @code{set-face-attribute} and @code{face-attribute}. |
| 2241 | 2232 | ||
| 2242 | @defun set-face-foreground face color &optional frame | 2233 | @defun set-face-foreground face color &optional frame |
| 2243 | @defunx set-face-background face color &optional frame | 2234 | @defunx set-face-background face color &optional frame |
| 2244 | These functions set the foreground (or background, respectively) color | 2235 | These functions set the foreground (or background, respectively) color |
| 2245 | of face @var{face} to @var{color}. The argument @var{color} should be a | 2236 | of face @var{face} to @var{color}. The argument @var{color} should be |
| 2246 | string, the name of a color. | 2237 | a string, the name of a color. |
| 2247 | |||
| 2248 | Certain shades of gray are implemented by stipple patterns on | ||
| 2249 | black-and-white screens. | ||
| 2250 | @end defun | 2238 | @end defun |
| 2251 | 2239 | ||
| 2252 | @defun set-face-stipple face pattern &optional frame | 2240 | @defun set-face-stipple face pattern &optional frame |
| 2253 | This function sets the background stipple pattern of face @var{face} | 2241 | This function sets the background stipple pattern of face @var{face} |
| 2254 | to @var{pattern}. The argument @var{pattern} should be the name of a | 2242 | to @var{pattern}. The argument PATTERN should be the name of a |
| 2255 | stipple pattern defined by the X server, or actual bitmap data | 2243 | stipple pattern defined by the X server, or actual bitmap data |
| 2256 | (@pxref{Face Attributes}), or @code{nil} meaning don't use stipple. | 2244 | (@pxref{Face Attributes}), or `nil' meaning don't use stipple. |
| 2257 | |||
| 2258 | Normally there is no need to pay attention to stipple patterns, because | ||
| 2259 | they are used automatically to handle certain shades of gray. | ||
| 2260 | @end defun | 2245 | @end defun |
| 2261 | 2246 | ||
| 2262 | @defun set-face-font face font &optional frame | 2247 | @defun set-face-font face font &optional frame |
| @@ -2672,7 +2657,9 @@ in @var{new-frame}. | |||
| 2672 | @end defun | 2657 | @end defun |
| 2673 | 2658 | ||
| 2674 | @defun face-id face | 2659 | @defun face-id face |
| 2675 | This function returns the face number of face @var{face}. | 2660 | This function returns the @dfn{face number} of face @var{face}. This |
| 2661 | is a number that uniquely identifies a face at low levels within | ||
| 2662 | Emacs. It is seldom necessary to refer to a face by its face number. | ||
| 2676 | @end defun | 2663 | @end defun |
| 2677 | 2664 | ||
| 2678 | @defun face-documentation face | 2665 | @defun face-documentation face |