[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: copy-face seems to work only for current frame
From: |
Eli Zaretskii |
Subject: |
Re: copy-face seems to work only for current frame |
Date: |
Tue, 27 Jan 2004 15:27:02 -0500 |
> From: Klaus Zeitler <kzeitler+usenet@gsm-mailhost.de.lucent.com>
> Newsgroups: gnu.emacs.help
> Date: 27 Jan 2004 15:51:59 +0100
>
> I don't understand this. I thought woman.el creates (via defface) the face
> woman-bold-face as soon as it gets loaded, then eval-after-load
> copies another face into woman-bold-face and that should be it.
defface does indeed run at load time, but the face copying is not a
magic wand: it can only copy into the face definitions of those frames
it finds in the value returned by (frame-list). And the new frame is
not there yet. Look at the code of copy-face, and you will see it.
> And I was so naive to think that this face would be used now in new
> frames too. Why not?
Because faces in Emacs are frame-local by design. Changing face
definitions on one frame doesn't propagate them to other frames,
unless some code walks the frame list and does that. copy-face indeed
does this walking, but it cannot do it for non-existing frames.
> Eli> Why don't you simply customize woman-bold-face? That's what one is
> Eli> supposed to do in such cases, you know ;-)
>
> Mostly habit I guess
A bad habit, I must say ;-)
You don't need to actually do it via M-x customize-face if you don't
like, simply use set-face-foreground etc. for woman-bold-face.
Re: copy-face seems to work only for current frame, Kevin Rodgers, 2004/01/27