changeset 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 2cbd801671c4
children 59060d7bf36c
files lisp/ChangeLog lisp/custom.el
diffstat 2 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Sep 12 21:58:21 2005 +0000
+++ b/lisp/ChangeLog	Mon Sep 12 22:05:17 2005 +0000
@@ -1,5 +1,8 @@
 2005-09-13  Chong Yidong  <cyd@stupidchicken.com>
 
+	* custom.el (custom-push-theme): Handle the case where a symbol is
+	bound but face properties have not yet been assigned.
+
 	* mail/sendmail.el (mail): Use new buffer if `noerase' argument is
 	`new'.
 
--- 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