summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-12-03 14:25:50 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-12-03 14:25:50 +0000
commit9ef706664e98e37e9633712126bae99869904677 (patch)
tree193bce7424700e4c7d70f54b04f7f81d64525554 /lisp/custom.el
parent950bed4bb96d2a580818bdaab64a164c7c9a1c1e (diff)
parent9f6efa0c78099f2f028c4db1db5a58567a1cfb4e (diff)
downloademacs-9ef706664e98e37e9633712126bae99869904677.tar.gz
Merged from miles@gnu.org--gnu-2005 (patch 659-663)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-659 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-660 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-661 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-662 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-663 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-445
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 0c6085c714f..b2a9ba6443c 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1120,9 +1120,14 @@ See `custom-theme-load-themes' for more information on BODY."
(defun enable-theme (theme)
"Reenable all variable and face settings defined by THEME.
The newly enabled theme gets the highest precedence (after `user').
-If it is already enabled, just give it highest precedence (after `user')."
+If it is already enabled, just give it highest precedence (after `user').
+
+This signals an error if THEME does not specify any theme
+settings. Theme settings are set using `load-theme'."
(interactive "SEnable Custom theme: ")
(let ((settings (get theme 'theme-settings)))
+ (if (and (not (eq theme 'user)) (null settings))
+ (error "No theme settings defined in %s." (symbol-name theme)))
(dolist (s settings)
(let* ((prop (car s))
(symbol (cadr s))
@@ -1130,7 +1135,8 @@ If it is already enabled, just give it highest precedence (after `user')."
(put symbol prop (cons (cddr s) (assq-delete-all theme spec-list)))
(if (eq prop 'theme-value)
(custom-theme-recalc-variable symbol)
- (custom-theme-recalc-face symbol)))))
+ (if (facep symbol)
+ (custom-theme-recalc-face symbol))))))
(setq custom-enabled-themes
(cons theme (delq theme custom-enabled-themes)))
;; `user' must always be the highest-precedence enabled theme.