[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107674: Fix interaction of load-them
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107674: Fix interaction of load-theme with cust-theme.el. |
Date: |
Sun, 25 Mar 2012 22:05:51 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107674
fixes bug(s): http://debbugs.gnu.org/11031
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2012-03-25 22:05:51 +0800
message:
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.
modified:
lisp/ChangeLog
lisp/cus-theme.el
lisp/custom.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-03-25 12:52:49 +0000
+++ b/lisp/ChangeLog 2012-03-25 14:05:51 +0000
@@ -1,8 +1,12 @@
2012-03-25 Chong Yidong <address@hidden>
+ * 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.
=== modified file 'lisp/cus-theme.el'
--- a/lisp/cus-theme.el 2012-03-25 12:52:49 +0000
+++ b/lisp/cus-theme.el 2012-03-25 14:05:51 +0000
@@ -81,7 +81,9 @@
(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 @@
(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))))
=== modified file 'lisp/custom.el'
--- a/lisp/custom.el 2012-02-22 06:10:03 +0000
+++ b/lisp/custom.el 2012-03-25 14:05:51 +0000
@@ -1143,8 +1143,9 @@
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 @@
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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107674: Fix interaction of load-theme with cust-theme.el.,
Chong Yidong <=