summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2012-03-25 22:04:52 +0200
committerJoakim Verona <joakim@verona.se>2012-03-25 22:04:52 +0200
commit75da28a3845b9dfa4e730cfa19c14edc52cbb222 (patch)
treeb04519bffcb21264cbe3ce8af13df7186548667f /lisp/custom.el
parentb827329a89291ed68dd017c53976be7ce5ed3b22 (diff)
parentf514f6f0e3f8bbeb5212d0337e5bda5a9a4eaeb5 (diff)
downloademacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.tar.gz
emacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.tar.bz2
emacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.zip
upstream
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 2f17ad36da0..bffd30bff21 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1143,8 +1143,9 @@ prompt the user for confirmation before loading it. But if
optional arg NO-CONFIRM is non-nil, load the theme without
prompting.
-Normally, this function also enables THEME; if optional arg
-NO-ENABLE is non-nil, load the theme but don't enable it.
+Normally, this function also enables THEME. If optional arg
+NO-ENABLE is non-nil, load the theme but don't enable it, unless
+the theme was already enabled.
This function is normally called through Customize when setting
`custom-enabled-themes'. If used directly in your init file, it
@@ -1160,6 +1161,10 @@ Return t if THEME was successfully loaded, nil otherwise."
nil nil))
(unless (custom-theme-name-valid-p theme)
(error "Invalid theme name `%s'" theme))
+ ;; If THEME is already enabled, re-enable it after loading, even if
+ ;; NO-ENABLE is t.
+ (if no-enable
+ (setq no-enable (not (custom-theme-enabled-p theme))))
;; If reloading, clear out the old theme settings.
(when (custom-theme-p theme)
(disable-theme theme)