Per Abrahamsen <abraham(a)dina.kvl.dk> writes:
Ok, I tried this (to avoid gnuclient interference):
xterm% xemacs
M-x customize-face RET custom-invalid-face RET
M-x make-frame-on-tty RET RET
Note you need an extra C-x 5 b RET and C-x b RET.
The problem happens only on the _second_ tty frame.
So, it is a bug introduced in 21.0. The code to initialize custom
faces for a new frame in 20.4 are `initialize-custom-faces' and
`custom-initialize-frame'. Does calling one of these manually in 21.0
helps?
(custom-initialize-frame (selected-frame)) does nothing but
(initialize-custom-faces (selected-frame)) cures the problem.
given this...
(defun custom-initialize-frame (frame)
"Initialize frame-local custom faces for FRAME if necessary."
(unless (equal (get-custom-frame-properties)
(get-custom-frame-properties frame))
(initialize-custom-faces frame)))
this would seem that get-custom-frame-properties somehow does
something different in 21.0.
In 21.0 on the second tty frame
(get-custom-frame-properties)
-> (type tty class mono background dark)
(Note that this is on an xterm with a white background!)
In 20.4 it was
(get-custom-frame-properties)
-> (type x class color background light)
Looks in faces.el:
(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))
20.4: (default-custom-frame-properties)
21.0: ;; We avoid this cache, because various frame and device
21.0: ;; properties can change.
21.0: ;;(default-custom-frame-properties)
(t
(setq default-custom-frame-properties
(extract-custom-frame-properties (selected-frame))))))
I think the problem is obvious. However I am not sure whether the 21.0
is more correct and there should be another way to fix this.
Also I cannot find where these functions are called and/or how the
initial frame on the new device gets the correct faces.
The most suspect changelog entry seems to
be
1998-03-27 Kyle Jones <kyle_jones(a)wonderworks.com>
* faces.el: Separated face intializations based on
device classes into device type specific (tag set,
instantiator) pairs.
Kyle, what did you do there?