From d5c16b05233c0c8c43f228071872e350834103c3 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 12 Sep 2005 22:05:17 +0000 Subject: [PATCH] * custom.el (custom-push-theme): Handle the case where a symbol is bound but face properties have not yet been assigned. --- lisp/ChangeLog | 3 +++ lisp/custom.el | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f9abe4ca871..2074b5d3f02 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2005-09-13 Chong Yidong + * 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'. diff --git a/lisp/custom.el b/lisp/custom.el index d634160e534..cf6ef88456e 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -649,17 +649,16 @@ See `custom-known-themes' for a list of known themes." (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 -- 2.39.2