summaryrefslogtreecommitdiff
path: root/lisp/cus-face.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cus-face.el')
-rw-r--r--lisp/cus-face.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index be88b499fef..900a815b160 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -40,15 +40,18 @@
(when (fboundp 'facep)
(unless (facep face)
;; If the user has already created the face, respect that.
- (let ((value (or (get face 'saved-face) spec)))
+ (let ((value (or (get face 'saved-face) spec))
+ (have-window-system (memq initial-window-system '(x w32))))
;; Create global face.
(make-empty-face face)
;; Create frame-local faces
(dolist (frame (frame-list))
- (face-spec-set face value frame)))
- ;; When making a face after frames already exist
- (if (memq window-system '(x w32 mac))
- (make-face-x-resource-internal face))))
+ (face-spec-set face value frame)
+ (when (memq (window-system frame) '(x w32 mac))
+ (setq have-window-system t)))
+ ;; When making a face after frames already exist
+ (if have-window-system
+ (make-face-x-resource-internal face)))))
;; Don't record SPEC until we see it causes no errors.
(put face 'face-defface-spec spec)
(push (cons 'defface face) current-load-list)