]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix interaction of load-theme with cust-theme.el.
authorChong Yidong <cyd@gnu.org>
Sun, 25 Mar 2012 14:05:51 +0000 (22:05 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 25 Mar 2012 14:05:51 +0000 (22:05 +0800)
* 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.

lisp/ChangeLog
lisp/cus-theme.el
lisp/custom.el

index 639d3f6d572b5a8e1532ed8ce6cd240c584949c8..a6220b11be76c1b044aefcdaa1bfde89af39ded5 100644 (file)
@@ -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.
 
index ba2fa969fc473e99c1b4e89c5e01239b7d3f6abf..606033f915c906d1c2fe33d8bc0331a18b717874 100644 (file)
@@ -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))))
 
index 2f17ad36da0a915be7f420e4acf31dde971acb45..bffd30bff211fc41b6eabd73432783b1c852a91a 100644 (file)
@@ -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)