[I posted this patch before. It is annoying not know whether it has
been forgotten or is just the subject of hot debate on xemacs-review]
Rationale:
The current interaction of XEmacs 21.0's custom with the Xresources is
an inconsistent and non-intuitive mess.
Both the X resources and Custom settings specify the font only
incompletely. The problem occurs when there are BOTH X resource and
Custom settings. Then there are basically two recipes/interpretations
A. [Custom is complete]
if there are ANY custom settings for the face)
Take default settings.
Apply changes in custom specifications.
else
Take default settings.
Apply changes in resources.
B. [Custom overrides]
Take default settings.
Apply changes in resources.
Apply changes in custom specifications.
Status Quo:
XEmacs 21.0 uses A for the 'default face and B. for others!
FSF 20.3 uses A (conclusion from code inspection only!).
XEmacs 20.4 uses B! (with a wrong value for "default settings"[1]).
Problems:
XEmacs 21.0 is inconsistent.
XEmacs 21.0 is incompatible with 20.4.
Some annoying user inter face problems (see Con using A).
Proposed solution:
Make XEmacs 21.0 use B. Always with the below patch.
Other solutions:
Make XEmacs 21.0 use B always (remove the init-face-from-resources
settings in face-spec-set).
+ document change in NEWS.
Pro's and Cons'.
Pro using A:
- Compatible with FSF 20.3
- One could argue this is the right interpretation. That attributes
arguments in the custom spec are just a form of writing minimal
data. However I think the way the customize face editor is
implemented suggests otherwise. Also the current call to
init-face-from-resources makes no sense then.
Cons using A:
- Incompatible with XEmacs 20.4
- It seems to be very unintuitive. I have seen a lot of complaints
already from Xresources users. They expect setting the back ground
color using resources to be independent of setting the
font size using custom. Note that this kind of mixing will become
more common in 21.0 because the font-menu now uses customize.
i.e. unsuspecting user uses font-menu ---> bingo his background is
gray again.
Cons of using this patch:
- It introduces yet another subtle change in the font behaviour.
[if you want you can leave the 'x tag bit for 21.2. I have only tested
this version though.]
1999-02-19 Jan Vroonhof <vroonhof(a)math.ethz.ch>
* x-faces.el (x-init-global-faces): Add default tag to specifiers,
so they can be overridden by x-init-face-from-resources.
Additionally specify the font name also with an x tag.
Index: x-faces.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/x-faces.el,v
retrieving revision 1.13
diff -u -u -r1.13 x-faces.el
--- x-faces.el 1999/03/05 14:06:20 1.13
+++ x-faces.el 1999/03/11 01:23:43
@@ -602,12 +602,12 @@
(defun x-init-global-faces ()
(or (face-font 'default 'global)
(set-face-font 'default
- "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*")
- 'global)
+ "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*"
+ 'global '(x default)))
(or (face-foreground 'default 'global)
- (set-face-foreground 'default "black" 'global 'x))
+ (set-face-foreground 'default "black" 'global '(x default)))
(or (face-background 'default 'global)
- (set-face-background 'default "gray80" 'global 'x)))
+ (set-face-background 'default "gray80" 'global '(x
default))))
;;; x-init-device-faces is responsible for initializing default
;;; values for faces on a newly created device.
Footnotes:
[1] I have seen only one report about this on c.e.xemacs which seems
to suggest to me almost all people change the default gray to
something else.