[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is (propertize "test" 'face '(foreground-color . "red")) valid?
From: |
Juanma Barranquero |
Subject: |
Is (propertize "test" 'face '(foreground-color . "red")) valid? |
Date: |
Mon, 08 Jul 2002 16:59:03 +0200 |
....or should it be
(propertize "test" 'face '((foreground-color . "red")))
?
From the Elisp reference (Text Properties / Special Properties):
> `face'
> You can use the property `face' to control the font and color of
> text. *Note Faces::, for more information.
>
> In the simplest case, the value is a face name. It can also be a
> list; then each element can be any of these possibilities;
>
> * A face name (a symbol or string).
>
> * Starting in Emacs 21, a property list of face attributes.
> This has the form (KEYWORD VALUE ...), where each KEYWORD is a
> face attribute name and VALUE is a meaningful value for that
> attribute. With this feature, you do not need to create a
> face each time you want to specify a particular attribute for
> certain text. *Note Face Attributes::.
>
> * A cons cell of the form `(foreground-color . COLOR-NAME)' or
> `(background-color . COLOR-NAME)'. These elements specify
> just the foreground color or just the background color.
>
> `(foreground-color . COLOR-NAME)' is equivalent to
> `(:foreground COLOR-NAME)', and likewise for the background.
>
To follow the docs, cons-cell values for the `face' property shouldn't
be valid. However, they work (at least, creating such a test string and
inserting it into a fundamental-mode buffer shows it colored).
Documentation bug, obsolete feature, or what?
/L/e/k/t/u
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Is (propertize "test" 'face '(foreground-color . "red")) valid?,
Juanma Barranquero <=