emacs-devel
[Top][All Lists]
Advanced

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

Problems with setting face attributes for specific frames


From: Richard Stallman
Subject: Problems with setting face attributes for specific frames
Date: Sun, 30 Sep 2007 08:54:56 -0400

In this message I propose a change in how faces work, in response
to the analysis of this bug.

The logic in `frame-set-background-mode' is correct for the case
of customizing `frame-background-mode'.  It distinguishes the
faces that match their defface specs from those for which attributes
were overridden (perhaps by calling `set-face-attribute').
It recalculates the former in the proper new way from the defface,
and it leaves the latter alone.

However, the logic is wrong for this case, where
`frame-set-background-mode' is called from `set-background-color'.  If
my analysis is correct, by the time `frame-set-background-mode' is
called, the new background color has already been installed in the
frame, but most faces still use the old one, so they do not match
their specs any more.

I think the code that handles faces needs to be cleaned up to keep
user-specified single-frame face attributes separately from the
actual face attributes deduced from the combination of all sources.
That is the only way to deduce new actual face attributes correctly
after changes in some of the parameters that the deduction is done from.

Or perhaps we should get rid of using `set-face-attribute' to specify
face attributes on a frame.

Not many packages call `set-face-attribute'.  There are just
two in Emacs that use it with a frame: ediff-wind.el
and mac-win.el.  pc-win.el calls it via `set-face-foreground'
and `set-face-background'.  The obsolete hilit19 package 
calls `set-face-font', but we could delete that.

Kifer, what is ediff-wind.el trying to do, and could it be done in
another way?

Eli, what is pc-win.el trying to do, and could it be done in
another way?  Perhaps by changing the deffaces for those faces?

What mac-win.el is doing is a very special case: obeying a user
command to set the frame's face.  Perhaps the right thing to do
is set the frame's `font' parameter.  In any case, a much more
limited feature, which can only apply to the default face,
would suffice for this job.




reply via email to

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