emacs-devel
[Top][All Lists]
Advanced

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

Re: Default font 'default have no corresponding variable


From: Lennart Borgman (gmail)
Subject: Re: Default font 'default have no corresponding variable
Date: Mon, 18 Feb 2008 23:14:40 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Stefan Monnier wrote:
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

      font-lock-FOO-face
or
      'font-lock-FOO-face

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.


Thanks Stefan and Jason,

It seems like I have been misunderstanding this a bit more than I usually do ;-)

Unfortunately I have been spreading my unwisdom a bit so I have to clear that out.

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".


        Stefan





reply via email to

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