[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mode-line-inactive and face inheritance
From: |
Stefan Monnier |
Subject: |
Re: mode-line-inactive and face inheritance |
Date: |
Tue, 19 Feb 2002 17:53:27 -0500 |
> More specifically, it adds an `all' entry which (just like `t')
> always matches but doesn't prevent subsequent specs from being
> considered.
> That seems useful. `common' might be clearer than `all'.
Actually, I think we can just reuse t instead of `all' or `common'.
Currently t can only be meaningfully used for the last entry,
so we can simply extend its meaning a little bit in a backward
compatible way.
> Also it allows nesting of display-specific specs
> so you can extract the common part of the `light' and `'dark'
> settings for `color' displays.
>
> That seems too complex; I think I would not want to document this
> even if it worked.
I'm ambivalent about it. I think it could also make things simpler.
Currently defface accepts a SPEC of the form:
SPEC ::= (CONDSPEC CONDSPEC ...)
CONDSPEC ::= (COND PROPS)
| (COND PROP PROP ...)
Where (COND PROPS) is an obsolete form kept for backward compatibility only.
The code I posted changes it to
SPEC ::= (CONDSPEC CONDSPEC ...)
CONDSPEC ::= (COND PROPS)
| (COND PROP PROP ...)
| (COND CONDSPEC CONDSPEC ...)
But an alternative way to get a similar result would be to use
SPEC ::= (CONDSPEC CONDSPEC ...)
| (PROP PROP ...)
CONDSPEC ::= (COND PROPS)
| (COND . SPEC)
which has the advantage that a simple defface that has no conditional
part could now be written as
(defface font-lock-doc-face
'(:inherit font-lock-string-face)
"Font Lock mode face used to highlight documentation."
:group 'font-lock-highlighting-faces)
instead of
(defface font-lock-doc-face
'((t :inherit font-lock-string-face))
"Font Lock mode face used to highlight documentation."
:group 'font-lock-highlighting-faces)
-- Stefan