Ar an cúigiú lá is fiche de mí Méan Fómhair, scríobh Ben Wing:
Hmmm ... seems to me that the sane behavior with an unrecognized tag
is
not to match on it. that way, an instantiator tagged with "msprinter"
will never apply on X windows, which is probably what you want.
i'm not totally averse to removing the error on unknown tags. i imagine
i put in the error on the principle that misspellings should be flagged
rather than silently ignored ... but i wasn't considering the situation
Aidan mentions. maybe in its place a warning could be issued, at the
same level as current warnings about unrecognized font/color/etc
names. (OTOH you can pretty easily define something like `msprinter'
unilaterally in all circumstances, even on a non-MSWindows ...)
Right, I’ve done that--the misspellings point is important. Thanks for your
input!
APPROVE COMMIT
NOTE: This patch has been committed.
lisp/ChangeLog addition:
2007-09-30 Aidan Kehoe <kehoea(a)parhasard.net>
* x-faces.el:
* x-faces.el ('x-resource)): Removed.
Specifier tag moved to specifier.el to ensure availability on
non-X builds.
* specifier.el:
Provide x, tty, mswindows, msprinter, gtk and carbon as device
tags that never match on builds that don't support them.
* specifier.el ('x-resource)): New.
Moved here from x-faces.el
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: lisp/specifier.el
===================================================================
RCS lisp/x-faces.el
===================================================================
RCS
Index: lisp/x-faces.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/x-faces.el,v
retrieving revision 1.29
diff -u -r1.29 x-faces.el
--- lisp/x-faces.el 2007/06/21 13:39:11 1.29
+++ lisp/x-faces.el 2007/09/30 11:57:37
@@ -654,7 +654,11 @@
;;; result in a crash.
;; When we initialise a face from an X resource, note that we did so.
-(define-specifier-tag 'x-resource)
+;;
+;; Now in specifier.el so run-time checks for it on non-X builds don't
+;; error.
+
+; (define-specifier-tag 'x-resource)
(defun x-init-face-from-resources (face &optional locale set-anyway)
Index: lisp/specifier.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/specifier.el,v
retrieving revision 1.16
diff -u -r1.16 specifier.el
--- lisp/specifier.el 2007/04/29 11:15:04 1.16
+++ lisp/specifier.el 2007/09/30 11:57:37
@@ -605,15 +605,10 @@
;;
;; from producing an error if no X support was compiled in.
-(or (valid-specifier-tag-p 'x)
- (define-specifier-tag 'x (lambda (dev) (eq (device-type dev) 'x))))
-(or (valid-specifier-tag-p 'tty)
- (define-specifier-tag 'tty (lambda (dev) (eq (device-type dev) 'tty))))
-(or (valid-specifier-tag-p 'mswindows)
- (define-specifier-tag 'mswindows (lambda (dev)
- (eq (device-type dev) 'mswindows))))
-(or (valid-specifier-tag-p 'gtk)
- (define-specifier-tag 'gtk (lambda (dev) (eq (device-type dev) 'gtk))))
+(loop
+ for tag in '(x tty mswindows msprinter gtk carbon)
+ do (unless (valid-specifier-tag-p tag)
+ (define-specifier-tag tag #'ignore)))
;; Add special tag for use by initialization code. Code that
;; sets up default specs should use this tag. Code that needs to
@@ -622,6 +617,11 @@
;; about clobbering user settings.
(define-specifier-tag 'default)
+
+;; The x-resource specifier tag is provide so the X resource initialization
+;; code can be overridden by custom without trouble.
+
+(define-specifier-tag 'x-resource)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; "Heuristic" specifier functions ;;;
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches