[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Face precedence
From: |
Oliver Scholz |
Subject: |
Re: Face precedence |
Date: |
Fri, 29 Oct 2004 23:53:34 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) |
Matthew Calhoun <calhounm@mac.com> writes:
> Hello,
>
> I'm trying to figure out what determines the order in which faces are
> applied to a block of text.
See (info "(elisp)Merging Faces")
> I have highlight face, which is applied to whatever line point is
> on, defined as white text on a dark background. But in programming
> modes I also have some syntax-related faces defined with a light
> background. Strangely, in some of these modes the highlight face's
> light foreground is applied, but not its dark background. Instead,
> the syntax face's light background is displayed, resulting in light
> text on a light background. What I would like to do is make sure
> that highlight face always takes precedence over whatever other
> faces are applied to the text.
Hm. If the highlighted line is implemented with an overlay and those
"syntax related faces" are implemented via text properties, then the
overlay should actually take precedence. Hm.
(progn (switch-to-buffer (generate-new-buffer "*tmp*"))
(font-lock-mode -1)
(insert (propertize "lirum larum"
'face '(face :background "magenta")))
(overlay-put (make-overlay (point-min) (point-max))
'face '(face :background "blue")))
Works here. How exactly is your highligted line implemented?
Oliver
--
8 Brumaire an 213 de la Révolution
Liberté, Egalité, Fraternité!
- Face precedence, Matthew Calhoun, 2004/10/29
- Re: Face precedence,
Oliver Scholz <=