diff lisp/custom.el @ 65480:c60d119298c4

* custom.el (custom-push-theme): Handle the case where a symbol is bound but face properties have not yet been assigned.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 12 Sep 2005 22:05:17 +0000
parents d82393ad9b2d
children 65d160cfd8f2 fa0da9b57058
line wrap: on
line diff
--- a/lisp/custom.el	Mon Sep 12 21:58:21 2005 +0000
+++ b/lisp/custom.el	Mon Sep 12 22:05:17 2005 +0000
@@ -649,17 +649,16 @@
 	(progn
 	  (setcar (cdr setting) mode)
 	  (setcar (cddr setting) value))
-      (if (and (null old)
-	       (boundp symbol))
-	  (setq old
-		(list
-		 (list 'standard 'set
-		       (if (eq prop 'theme-value)
-			   (symbol-value symbol)
-			 (list
-			  (append
-			   '(t)
-			   (custom-face-attributes-get symbol nil))))))))
+      ;; If no custom theme has been applied yet, first save the
+      ;; current values to the 'standard theme.
+      (if (null old)
+	  (if (and (eq prop 'theme-value)
+		   (boundp symbol))
+	      (setq old
+		    (list (list 'standard 'set (symbol-value symbol))))
+	    (if (facep symbol)
+		(setq old (list (list 'standard 'set (list
+		  (append '(t) (custom-face-attributes-get symbol nil)))))))))
       (put symbol prop (cons (list theme mode value) old)))
     ;; Record, for each theme, all its settings.
     (put theme 'theme-settings