summaryrefslogtreecommitdiff
path: root/lisp/cus-theme.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-02-01 12:34:07 -0500
committerChong Yidong <cyd@stupidchicken.com>2011-02-01 12:34:07 -0500
commit928f4e732d8b605b682cb6d41c9452028083047a (patch)
treeb39b90a80e1af3ac24fccdc675a1293c53710ca4 /lisp/cus-theme.el
parent7d1166478188fe1fe014d3b64c22641c4fac6a25 (diff)
downloademacs-928f4e732d8b605b682cb6d41c9452028083047a.tar.gz
Drop use of unsafep for checking Custom themes; bugfixes.
* lisp/custom.el (load-theme): Define return value. Drop use of unsafep; call custom-theme-load-confirm for non-known-safe themes. (custom-theme-load-confirm): Scroll in the correct window. (custom-enabled-themes): Add custom-safe-themes to :set-after. * lisp/cus-theme.el (custom-theme-checkbox-toggle): Don't activate the checkbox if load-theme fails.
Diffstat (limited to 'lisp/cus-theme.el')
-rw-r--r--lisp/cus-theme.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index f29dd9eb213..cdc066aa91a 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -621,7 +621,9 @@ Theme files are named *-theme.el in `"))
(let ((this-theme (widget-get widget :theme-name)))
(if (widget-value widget)
;; Disable the theme.
- (disable-theme this-theme)
+ (progn
+ (disable-theme this-theme)
+ (widget-toggle-action widget event))
;; Enable the theme.
(unless custom-theme-allow-multiple-selections
;; If only one theme is allowed, disable all other themes and
@@ -634,12 +636,11 @@ Theme files are named *-theme.el in `"))
(unless (eq (car theme) this-theme)
(widget-value-set (cdr theme) nil)
(widget-apply (cdr theme) :notify (cdr theme) event))))
- (load-theme this-theme)))
- ;; Mark `custom-enabled-themes' as "set for current session".
- (put 'custom-enabled-themes 'customized-value
- (list (custom-quote custom-enabled-themes)))
- ;; Check/uncheck the widget.
- (widget-toggle-action widget event))
+ (when (load-theme this-theme)
+ (widget-toggle-action widget event)))
+ ;; Mark `custom-enabled-themes' as "set for current session".
+ (put 'custom-enabled-themes 'customized-value
+ (list (custom-quote custom-enabled-themes)))))
(defun custom-describe-theme ()
"Describe the Custom theme on the current line."