Ar an dara lá déag de mí na Samhain, scríobh Vin Shelton:
[...] 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.
It’s in #'get-frame-background-mode; the calculation is cached where it
shouldn’t be. I can avoid, e.g. font-lock-comment-face being blue4 with the
following patch:
diff -r 3b1d4fa716a4 lisp/faces.el
--- a/lisp/faces.el Sun Nov 13 17:13:52 2011 +0000
+++ b/lisp/faces.el Sun Nov 13 21:38:07 2011 +0000
@@ -1586,7 +1586,6 @@
(device-type (frame-device frame)))
'class (device-class (frame-device frame))
'background (or frame-background-mode
- (frame-property frame 'background-mode)
(get-frame-background-mode frame))))
(defcustom init-face-from-resources t
@@ -1647,15 +1646,7 @@
(defun get-custom-frame-properties (&optional frame)
"Return a plist with the frame properties of FRAME used by custom.
If FRAME is nil, return the default frame properties."
- (cond (frame
- ;; Try to get from cache.
- (let ((cache (frame-property frame 'custom-properties)))
- (unless cache
- ;; Oh well, get it then.
- (setq cache (extract-custom-frame-properties frame))
- ;; and cache it...
- (set-frame-property frame 'custom-properties cache))
- cache))
+ (cond (frame (extract-custom-frame-properties frame))
(default-custom-frame-properties)
(t
(setq default-custom-frame-properties
[...] 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.
Right. I suspect most people did and do, and that’s why the porting of the
custom code to work with XEmacs specifiers was never really done that
thoroughly.
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta