Greetings -
If I do the following in my .emacs:
(set-face-foreground 'default "LightYellow")
(set-face-background 'default "Black")
The custom-properties of the current frame do not change:
(frame-property (selected-frame) 'custom-properties) ==>
(type x class color background light)
even though the 'background property should be 'dark after the
set-face-background call. The fact that the background is
mis-identified as 'light, confuses font-lock and hyper-apropos (and
probably other libraries) into using the wrong foreground color for
fonts. For instance, font-lock-comment-face (in the current frame)
has a color of blue4 instead of gray80. Here is the definition of
font-lock-comment-face from font-lock.el:
(defface font-lock-comment-face
'((((class color) (background dark)) (:foreground "gray80"))
;; blue4 is hardly different from black on windows.
(((class color) (background light) (type mswindows)) (:foreground "blue"))
(((class color) (background light)) (:foreground "blue4"))
(((class grayscale) (background light))
(:foreground "DimGray" :bold t :italic t))
(((class grayscale) (background dark))
(:foreground "LightGray" :bold t :italic t))
(t (:bold t)))
"Font Lock mode face used to highlight comments."
:group 'font-lock-faces)
You can see that it's matching the (background light) specifier
instead of (background dark).
Subsequent frames get the right interpretation of background color:
(make-frame)
(frame-property (selected-frame) 'custom-properties) ==>
(type x class color background dark)
Does anyone know where the calculation is done that deduces whether
the frame's background is light or dark? It seems the
(set-face-background 'default ....) should call that code.
BTW, here's how I'm working around this particular problem:
;; Set faces and colors
(and (equal (emacs-type) "xemacs")
(set-face-font 'default "-*-dejavu sans
mono-medium-r-normal--12-*-*-*-m-*-iso8859-1")
(set-face-foreground 'default "LightYellow")
(set-face-background 'default "Black"))
;; Workaround #4
(setq initial-frame-plist '(custom-properties (class color background dark)))
(frame-notice-user-settings)
I never used to have this problem because I used X resources to set
the foreground and background color and that caused the
custom-properties to get set correctly prior to the instantiation of
the first frame.
Thanks,
Vin
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta