changeset 48522:70e8f2b6672e

(face-set-after-frame-default): Ignore errors in face-spec-face-set.
author Richard M. Stallman <rms@gnu.org>
date Sun, 24 Nov 2002 18:59:08 +0000
parents e8d332923257
children 442a4d06a99f
files lisp/faces.el
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Sun Nov 24 18:58:35 2002 +0000
+++ b/lisp/faces.el	Sun Nov 24 18:59:08 2002 +0000
@@ -1669,15 +1669,17 @@
 (defun face-set-after-frame-default (frame)
   "Set frame-local faces of FRAME from face specs and resources.
 Initialize colors of certain faces from frame parameters."
+  ;; Don't let frame creation fail because of an invalid face spec.
   (dolist (face (face-list))
-    (when (not (equal face 'default))
-      (face-spec-set face (face-user-default-spec face) frame)
-      (internal-merge-in-global-face face frame)
-      (when (and (memq window-system '(x w32 mac))
-		 (or (not (boundp 'inhibit-default-face-x-resources))
-		     (not (eq face 'default))))
-	(make-face-x-resource-internal face frame))))
-
+    (condition-case ()
+	(when (not (equal face 'default))
+	  (face-spec-set face (face-user-default-spec face) frame)
+	  (internal-merge-in-global-face face frame)
+	  (when (and (memq window-system '(x w32 mac))
+		     (or (not (boundp 'inhibit-default-face-x-resources))
+			 (not (eq face 'default))))
+	    (make-face-x-resource-internal face frame)))
+      (error nil)))
   ;; Initialize attributes from frame parameters.
   (let ((params '((foreground-color default :foreground)
 		  (background-color default :background)