help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Background colors in font-lock-keywords


From: Oliver Scholz
Subject: Re: Background colors in font-lock-keywords
Date: Wed, 28 May 2003 18:13:01 +0200
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt)

lawrence mitchell <address@hidden> writes:

> Oliver Scholz wrote:
>
> [...] PREPEND versus APPEND in font-lock-keywords.
>
>> Erm, this code was just example code, so I am personally not so sure
>> which one should take precedence, the old fontification or the new
>> one. It's hard for me to make an educated guess, because the major
>> mode has no meaning, and so the fontification has no meaning.
>
>> But maybe you have a more general reason to say this. Could you
>> please elaborate?
>
> The way I read it, if using `append', rather than `prepend',
> in the example above, EXAMPLE-L-WORD-FACE would change the
> background iff FONT-LOCK-WARNING-FACE and
> FONT-LOCK-KEYWORD-FACE, did not set the background colour.
> Certainly in my Emacs setup, said faces have had their
> backgrounds set explicitly.
[...]

That's true; this is what the "precedence" is about. However, if a
user sets the background colour of `font-lock-warning-face'
etc. explicitely, she probably attaches some intensional significance
with it. Maybe the background colour even is the only face attribute
of `font-lock-warning-face' in her configuration?

Whether it is a bug or a feature to override this or to not override
this, depends entirely on what is more important. Is it more important
to highlight "lirum" and "larum" as special words or is it more
important to highlight words beginning with "l"? Maybe it's nice but
not necessary to highlight "lambda" and "lalala", but "lirum" and
"larum" are *the* important keywords to watch out for? In this case it
is a bug to highlight "lirum" and "larum" as `words beginning with l'.

I have no idea what is the proper thing to do for `example-mode'. And
I am the author of it. :-|

    Oliver
-- 
9 Prairial an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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