[Top][All Lists]

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

RE: Default font 'default have no corresponding variable

From: Drew Adams
Subject: RE: Default font 'default have no corresponding variable
Date: Tue, 19 Feb 2008 19:51:46 -0800

> Maybe we should work harder to document the fact that we do not want
> such variables.  Where would such info have reached you better?
> How about if we put comments in and among the variable definitions in
> font-lock.el saying not to imitate that practice.

I think the place to discuss this is in the Elisp manual, in one of the
sections about faces. This is really about understanding what a face is,

FWIW, I have a slightly different take on the practice to recommend and the
reasons to give for that recommendation. 

I agree with the recommended practice of defining and using faces, not face
variables, in general - and I follow it. However, I don't agree that the
only case for defining and using face variables is the legacy case of the
font-lock code. 

The use case I see, which, again, is not the usual case, is when you want to
make it easy for code to temporarily use a particular face. It is very easy
for some code to dynamically bind a face variable and cause subsequently
executed code to use that face. Getting the same effect with faces (without
a face variable) can make for uglier code, IMO.

Just one opinion. I'm not interested in arguing about that. I agree that we
should make it clear that you generally should not define face variables.
And I think the place to communicate that guideline is the Elisp doc, not
just comments in the code.

reply via email to

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