* Is (propertize "test" 'face '(foreground-color . "red")) valid?
@ 2002-07-08 14:59 Juanma Barranquero
0 siblings, 0 replies; only message in thread
From: Juanma Barranquero @ 2002-07-08 14:59 UTC (permalink / raw)
....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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-08 14:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-08 14:59 Is (propertize "test" 'face '(foreground-color . "red")) valid? Juanma Barranquero
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).