[Top][All Lists]

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

Re: Default font 'default have no corresponding variable

From: Stefan Monnier
Subject: Re: Default font 'default have no corresponding variable
Date: Mon, 18 Feb 2008 11:48:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> Why should there be a "corresponding variable"?

> Maybe I got this wrong, I thought that there usually were a variable with
> the same name as the face and that the variable value was the face
> symbol. But maybe that is just used for faces defined specific uses in
> Emacs libraries?

No.  The only there is w.r.t vars and faces is that font-lock's author
originally decided to provide both font-lock-FOO-face faces and
font-lock-FOO-face variables where the variable's value points to the
face, so that you can use


and get the same result.  Basically it makes the font-lock-FOO-face
symbol (used to refer to the face) self-quoting.  And since most
font-lock rules use the first form rather than the second, you get the
added benefit that the extra-indirection through the variable can be
made buffer-local so you can "change faces" on a buffer-by-buffer basis
(which is usually not possible in Emacs where faces can only be changed
on a frame-by-frame basis).

In any case, buffer-local faces should be added to Emacs (there are
plans to do that, although they don't seem to be going anywhere, sadly),
and variables pointing to faces are generally deprecated unless maybe
they're used in font-lock rules where avoiding the ' can be
marginally convenient.

> But anyway, as I wrote, libraries written for XEmacs often tends to assume
> that the variable default exist (and points to a face symbol I believe).

`xemacs -q' tells me that `default' indeed exists but has value "void".
Not sure what that means.  It seems not to have any equivalent in Emacs.
I'd never heard of it until now, so it can't be that used "often".


reply via email to

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