diff options
| author | Chong Yidong | 2012-03-25 22:05:51 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-03-25 22:05:51 +0800 |
| commit | 4125cb8b6550521126fb5023734abde62c7aef16 (patch) | |
| tree | ccc500e961d006651868404d6eaa38381660b484 /lisp | |
| parent | e0fe1d55893865df47efceb68551c245f12ceda3 (diff) | |
| download | emacs-4125cb8b6550521126fb5023734abde62c7aef16.tar.gz emacs-4125cb8b6550521126fb5023734abde62c7aef16.zip | |
Fix interaction of load-theme with cust-theme.el.
* lisp/custom.el (load-theme): Even if NO-ENABLE arg is t, reenable the
theme if it was previously enabled before (Bug#11031).
* lisp/cus-theme.el (customize-create-theme, custom-theme-revert): Doc fixes.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/cus-theme.el | 6 | ||||
| -rw-r--r-- | lisp/custom.el | 9 |
3 files changed, 16 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 639d3f6d572..a6220b11be7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,8 +1,12 @@ | |||
| 1 | 2012-03-25 Chong Yidong <cyd@gnu.org> | 1 | 2012-03-25 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * custom.el (load-theme): Even if NO-ENABLE arg is t, reenable the | ||
| 4 | theme if it was previously enabled before (Bug#11031). | ||
| 5 | |||
| 3 | * cus-theme.el (custom-theme-write-faces): Retrieve current face | 6 | * cus-theme.el (custom-theme-write-faces): Retrieve current face |
| 4 | spec with custom-face-get-current-spec if its :shown-value is not | 7 | spec with custom-face-get-current-spec if its :shown-value is not |
| 5 | determined yet (Bug#9337). | 8 | determined yet (Bug#9337). |
| 9 | (customize-create-theme, custom-theme-revert): Doc fixes. | ||
| 6 | 10 | ||
| 7 | * button.el (button-at): Minor addition to docstring. | 11 | * button.el (button-at): Minor addition to docstring. |
| 8 | 12 | ||
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index ba2fa969fc4..606033f915c 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el | |||
| @@ -81,7 +81,9 @@ Do not call this mode function yourself. It is meant for internal use." | |||
| 81 | (defun customize-create-theme (&optional theme buffer) | 81 | (defun customize-create-theme (&optional theme buffer) |
| 82 | "Create or edit a custom theme. | 82 | "Create or edit a custom theme. |
| 83 | THEME, if non-nil, should be an existing theme to edit. If THEME | 83 | THEME, if non-nil, should be an existing theme to edit. If THEME |
| 84 | is `user', provide an option to remove these as custom settings. | 84 | is `user', the resulting *Custom Theme* buffer also contains a |
| 85 | checkbox for removing the theme settings specified in the buffer | ||
| 86 | from the Custom save file. | ||
| 85 | BUFFER, if non-nil, should be a buffer to use; the default is | 87 | BUFFER, if non-nil, should be a buffer to use; the default is |
| 86 | named *Custom Theme*." | 88 | named *Custom Theme*." |
| 87 | (interactive) | 89 | (interactive) |
| @@ -209,6 +211,8 @@ remove them from your saved Custom file.\n\n")) | |||
| 209 | (message ""))) | 211 | (message ""))) |
| 210 | 212 | ||
| 211 | (defun custom-theme-revert (_ignore-auto noconfirm) | 213 | (defun custom-theme-revert (_ignore-auto noconfirm) |
| 214 | "Revert the current *Custom Theme* buffer. | ||
| 215 | This is the `revert-buffer-function' for `custom-new-theme-mode'." | ||
| 212 | (when (or noconfirm (y-or-n-p "Discard current changes? ")) | 216 | (when (or noconfirm (y-or-n-p "Discard current changes? ")) |
| 213 | (customize-create-theme custom-theme--save-name (current-buffer)))) | 217 | (customize-create-theme custom-theme--save-name (current-buffer)))) |
| 214 | 218 | ||
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 | |||
| 1143 | optional arg NO-CONFIRM is non-nil, load the theme without | 1143 | optional arg NO-CONFIRM is non-nil, load the theme without |
| 1144 | prompting. | 1144 | prompting. |
| 1145 | 1145 | ||
| 1146 | Normally, this function also enables THEME; if optional arg | 1146 | Normally, this function also enables THEME. If optional arg |
| 1147 | NO-ENABLE is non-nil, load the theme but don't enable it. | 1147 | NO-ENABLE is non-nil, load the theme but don't enable it, unless |
| 1148 | the theme was already enabled. | ||
| 1148 | 1149 | ||
| 1149 | This function is normally called through Customize when setting | 1150 | This function is normally called through Customize when setting |
| 1150 | `custom-enabled-themes'. If used directly in your init file, it | 1151 | `custom-enabled-themes'. If used directly in your init file, it |
| @@ -1160,6 +1161,10 @@ Return t if THEME was successfully loaded, nil otherwise." | |||
| 1160 | nil nil)) | 1161 | nil nil)) |
| 1161 | (unless (custom-theme-name-valid-p theme) | 1162 | (unless (custom-theme-name-valid-p theme) |
| 1162 | (error "Invalid theme name `%s'" theme)) | 1163 | (error "Invalid theme name `%s'" theme)) |
| 1164 | ;; If THEME is already enabled, re-enable it after loading, even if | ||
| 1165 | ;; NO-ENABLE is t. | ||
| 1166 | (if no-enable | ||
| 1167 | (setq no-enable (not (custom-theme-enabled-p theme)))) | ||
| 1163 | ;; If reloading, clear out the old theme settings. | 1168 | ;; If reloading, clear out the old theme settings. |
| 1164 | (when (custom-theme-p theme) | 1169 | (when (custom-theme-p theme) |
| 1165 | (disable-theme theme) | 1170 | (disable-theme theme) |