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.
This commit is contained in:
parent
e0fe1d5589
commit
4125cb8b65
3 changed files with 16 additions and 3 deletions
|
|
@ -1,8 +1,12 @@
|
|||
2012-03-25 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* custom.el (load-theme): Even if NO-ENABLE arg is t, reenable the
|
||||
theme if it was previously enabled before (Bug#11031).
|
||||
|
||||
* cus-theme.el (custom-theme-write-faces): Retrieve current face
|
||||
spec with custom-face-get-current-spec if its :shown-value is not
|
||||
determined yet (Bug#9337).
|
||||
(customize-create-theme, custom-theme-revert): Doc fixes.
|
||||
|
||||
* button.el (button-at): Minor addition to docstring.
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,9 @@ Do not call this mode function yourself. It is meant for internal use."
|
|||
(defun customize-create-theme (&optional theme buffer)
|
||||
"Create or edit a custom theme.
|
||||
THEME, if non-nil, should be an existing theme to edit. If THEME
|
||||
is `user', provide an option to remove these as custom settings.
|
||||
is `user', the resulting *Custom Theme* buffer also contains a
|
||||
checkbox for removing the theme settings specified in the buffer
|
||||
from the Custom save file.
|
||||
BUFFER, if non-nil, should be a buffer to use; the default is
|
||||
named *Custom Theme*."
|
||||
(interactive)
|
||||
|
|
@ -209,6 +211,8 @@ remove them from your saved Custom file.\n\n"))
|
|||
(message "")))
|
||||
|
||||
(defun custom-theme-revert (_ignore-auto noconfirm)
|
||||
"Revert the current *Custom Theme* buffer.
|
||||
This is the `revert-buffer-function' for `custom-new-theme-mode'."
|
||||
(when (or noconfirm (y-or-n-p "Discard current changes? "))
|
||||
(customize-create-theme custom-theme--save-name (current-buffer))))
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue