diff options
| author | Chong Yidong | 2011-02-01 12:34:07 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-02-01 12:34:07 -0500 |
| commit | 928f4e732d8b605b682cb6d41c9452028083047a (patch) | |
| tree | b39b90a80e1af3ac24fccdc675a1293c53710ca4 /lisp/cus-theme.el | |
| parent | 7d1166478188fe1fe014d3b64c22641c4fac6a25 (diff) | |
| download | emacs-928f4e732d8b605b682cb6d41c9452028083047a.tar.gz emacs-928f4e732d8b605b682cb6d41c9452028083047a.zip | |
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.el | 15 |
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 `")) | |||
| 621 | (let ((this-theme (widget-get widget :theme-name))) | 621 | (let ((this-theme (widget-get widget :theme-name))) |
| 622 | (if (widget-value widget) | 622 | (if (widget-value widget) |
| 623 | ;; Disable the theme. | 623 | ;; Disable the theme. |
| 624 | (disable-theme this-theme) | 624 | (progn |
| 625 | (disable-theme this-theme) | ||
| 626 | (widget-toggle-action widget event)) | ||
| 625 | ;; Enable the theme. | 627 | ;; Enable the theme. |
| 626 | (unless custom-theme-allow-multiple-selections | 628 | (unless custom-theme-allow-multiple-selections |
| 627 | ;; If only one theme is allowed, disable all other themes and | 629 | ;; If only one theme is allowed, disable all other themes and |
| @@ -634,12 +636,11 @@ Theme files are named *-theme.el in `")) | |||
| 634 | (unless (eq (car theme) this-theme) | 636 | (unless (eq (car theme) this-theme) |
| 635 | (widget-value-set (cdr theme) nil) | 637 | (widget-value-set (cdr theme) nil) |
| 636 | (widget-apply (cdr theme) :notify (cdr theme) event)))) | 638 | (widget-apply (cdr theme) :notify (cdr theme) event)))) |
| 637 | (load-theme this-theme))) | 639 | (when (load-theme this-theme) |
| 638 | ;; Mark `custom-enabled-themes' as "set for current session". | 640 | (widget-toggle-action widget event))) |
| 639 | (put 'custom-enabled-themes 'customized-value | 641 | ;; Mark `custom-enabled-themes' as "set for current session". |
| 640 | (list (custom-quote custom-enabled-themes))) | 642 | (put 'custom-enabled-themes 'customized-value |
| 641 | ;; Check/uncheck the widget. | 643 | (list (custom-quote custom-enabled-themes))))) |
| 642 | (widget-toggle-action widget event)) | ||
| 643 | 644 | ||
| 644 | (defun custom-describe-theme () | 645 | (defun custom-describe-theme () |
| 645 | "Describe the Custom theme on the current line." | 646 | "Describe the Custom theme on the current line." |