[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Q on multiple faces as text property `face'

From: Drew Adams
Subject: Q on multiple faces as text property `face'
Date: Sat, 18 Feb 2006 10:10:56 -0800

I have two faces:
(defface face1 '((t (:background "White"))) "Face 1")
(defface face2 '((t (:foreground "Blue"))) "Face 2")

Using `put-text-property' with the `face' property:
  I put face2 on some text.
  I put face1 on some text.

I would like the result to show, wherever both faces are applied to the same
text, both a Blue foreground and White background. However, what happens is
that the last face applied takes precedence - the other face contributes

I also tried with definitions like this, also to no avail:
(defface face1 '((t (:background "White" :foreground unspecified))) "1")
(defface face2 '((t (:foreground "Blue"  :backround unspecified))) "2")

What's the correct way to do what I want: accumulate (merge) properties from
different faces? (No, I don't want to use overlays here.)

I've consulted the Elisp manual, looked through the code in `faces.el', and
`grep'ed for occurrences of `unspecified' in the Emacs Lisp sources, but
it's still not clear to me how this is supposed to work.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]