Bugfixes for `customize-create-theme'.

* cus-theme.el (customize-create-theme): Delete overlays after
erasing.  If given a THEME arg, display only the faces of that arg
instead of custom-theme--listed-faces.
(custom-theme-variable-menu, custom-theme-variable-action)
(custom-variable-reset-theme, custom-theme-delete-variable): Deleted.
(custom-theme-add-variable, custom-theme-add-face): Apply value
from the theme settings, instead of the current value.
(custom-theme-add-var-1, custom-theme-add-face-1): New functions.
(custom-theme-visit-theme): Allow calling outside theme buffers.
(custom-theme-merge-theme): Don't enable the theme when merging.
(custom-theme-write-variables, custom-theme-write-faces): Use the
:shown-value properties to save buffer values, not global ones.
(customize-themes): Display a warning about user customizations.

* cus-edit.el (custom-variable-value-create)
(custom-face-value-create): Obey new special properties
:shown-value and :inhibit-magic.
This commit is contained in:
Chong Yidong 2010-10-15 20:16:34 -04:00
parent e3fc5b1907
commit da16abfc7e
3 changed files with 235 additions and 239 deletions

View file

@ -1,3 +1,23 @@
2010-10-16 Chong Yidong <cyd@stupidchicken.com>
* cus-theme.el (customize-create-theme): Delete overlays after
erasing. If given a THEME arg, display only the faces of that arg
instead of custom-theme--listed-faces.
(custom-theme-variable-menu, custom-theme-variable-action)
(custom-variable-reset-theme, custom-theme-delete-variable): Deleted.
(custom-theme-add-variable, custom-theme-add-face): Apply value
from the theme settings, instead of the current value.
(custom-theme-add-var-1, custom-theme-add-face-1): New functions.
(custom-theme-visit-theme): Allow calling outside theme buffers.
(custom-theme-merge-theme): Don't enable the theme when merging.
(custom-theme-write-variables, custom-theme-write-faces): Use the
:shown-value properties to save buffer values, not global ones.
(customize-themes): Display a warning about user customizations.
* cus-edit.el (custom-variable-value-create)
(custom-face-value-create): Obey new special properties
:shown-value and :inhibit-magic.
2010-10-15 Michael Albinus <michael.albinus@gmx.de> 2010-10-15 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):

View file

@ -2460,7 +2460,13 @@ The following properties have special meanings for this widget:
:custom-form should be a symbol describing how to display and :custom-form should be a symbol describing how to display and
edit the variable---either `edit' (using edit widgets), edit the variable---either `edit' (using edit widgets),
`lisp' (as a Lisp sexp), or `mismatch' (should not happen); `lisp' (as a Lisp sexp), or `mismatch' (should not happen);
if nil, use the return value of `custom-variable-default-form'." if nil, use the return value of `custom-variable-default-form'.
:shown-value, if non-nil, should be a list whose `car' is the
variable value to display in place of the current value.
:inhibit-magic, if non-nil, inhibits creating the magic
custom-state widget."
:format "%v" :format "%v"
:help-echo "Set or reset this variable." :help-echo "Set or reset this variable."
:documentation-property #'custom-variable-documentation :documentation-property #'custom-variable-documentation
@ -2512,9 +2518,12 @@ try matching its doc string against `custom-guess-doc-alist'."
(get (or (get symbol 'custom-get) 'default-value)) (get (or (get symbol 'custom-get) 'default-value))
(prefix (widget-get widget :custom-prefix)) (prefix (widget-get widget :custom-prefix))
(last (widget-get widget :custom-last)) (last (widget-get widget :custom-last))
(value (if (default-boundp symbol) (value (let ((shown-value (widget-get widget :shown-value)))
(funcall get symbol) (cond (shown-value
(widget-get conv :value))) (car shown-value))
((default-boundp symbol)
(funcall get symbol))
(t (widget-get conv :value)))))
(state (or (widget-get widget :custom-state) (state (or (widget-get widget :custom-state)
(if (memq (custom-variable-state symbol value) (if (memq (custom-variable-state symbol value)
(widget-get widget :hidden-states)) (widget-get widget :hidden-states))
@ -2622,10 +2631,11 @@ try matching its doc string against `custom-guess-doc-alist'."
(unless (eq (preceding-char) ?\n) (unless (eq (preceding-char) ?\n)
(widget-insert "\n")) (widget-insert "\n"))
;; Create the magic button. ;; Create the magic button.
(let ((magic (widget-create-child-and-convert (unless (widget-get widget :inhibit-magic)
widget 'custom-magic nil))) (let ((magic (widget-create-child-and-convert
(widget-put widget :custom-magic magic) widget 'custom-magic nil)))
(push magic buttons)) (widget-put widget :custom-magic magic)
(push magic buttons)))
(widget-put widget :buttons buttons) (widget-put widget :buttons buttons)
;; Insert documentation. ;; Insert documentation.
(widget-put widget :documentation-indent 3) (widget-put widget :documentation-indent 3)
@ -3281,12 +3291,17 @@ The following properties have special meanings for this widget:
Lisp sexp), or `mismatch' (should not happen); if nil, use Lisp sexp), or `mismatch' (should not happen); if nil, use
the return value of `custom-face-default-form'. the return value of `custom-face-default-form'.
:display-style, if non-nil, should be a symbol describing the :display-style, if non-nil, describes the style of display to
style of display to use. If the value is `concise', a more use. If the value is `concise', a neater interface is shown.
concise interface is shown.
:sample-indent, if non-nil, should be an integer; this is the :sample-indent, if non-nil, is the number of columns to which to
number of columns to which to indent the face sample." indent the face sample (an integer).
:shown-value, if non-nil, is the face spec to display as the value
of the widget, instead of the current face spec.
:inhibit-magic, if non-nil, inhibits creating the magic
custom-state widget."
:sample-face 'custom-face-tag :sample-face 'custom-face-tag
:help-echo "Set or reset this face." :help-echo "Set or reset this face."
:documentation-property #'face-doc-string :documentation-property #'face-doc-string
@ -3429,14 +3444,19 @@ WIDGET should be a `custom-face' widget."
(indent-to-column sample-indent))) (indent-to-column sample-indent)))
(push (widget-create-child-and-convert (push (widget-create-child-and-convert
widget 'item widget 'item
:format "[%{%t%}]" :sample-face symbol :tag "sample") :format "[%{%t%}]"
:sample-face (let ((spec (widget-get widget :shown-value)))
(if spec (face-spec-choose spec) symbol))
:tag "sample")
buttons) buttons)
;; Magic.
(insert "\n") (insert "\n")
(let ((magic (widget-create-child-and-convert
widget 'custom-magic nil))) ;; Magic.
(widget-put widget :custom-magic magic) (unless (widget-get widget :inhibit-magic)
(push magic buttons)) (let ((magic (widget-create-child-and-convert
widget 'custom-magic nil)))
(widget-put widget :custom-magic magic)
(push magic buttons)))
;; Update buttons. ;; Update buttons.
(widget-put widget :buttons buttons) (widget-put widget :buttons buttons)
@ -3465,7 +3485,8 @@ WIDGET should be a `custom-face' widget."
(unless (widget-get widget :custom-form) (unless (widget-get widget :custom-form)
(widget-put widget :custom-form custom-face-default-form)) (widget-put widget :custom-form custom-face-default-form))
(let* ((spec (custom-face-get-current-spec symbol)) (let* ((spec (or (widget-get widget :shown-value)
(custom-face-get-current-spec symbol)))
(form (widget-get widget :custom-form)) (form (widget-get widget :custom-form))
(indent (widget-get widget :indent)) (indent (widget-get widget :indent))
face-alist face-entry spec-default spec-match editor) face-alist face-entry spec-default spec-match editor)

View file

@ -79,12 +79,14 @@ Do not call this mode function yourself. It is meant for internal use."
(defun customize-create-theme (&optional theme buffer) (defun customize-create-theme (&optional theme buffer)
"Create or edit a custom theme. "Create or edit a custom theme.
THEME, if non-nil, should be an existing theme to edit. THEME, if non-nil, should be an existing theme to edit.
BUFFER, if non-nil, should be a buffer to use." BUFFER, if non-nil, should be a buffer to use; the default is
named *Custom Theme*."
(interactive) (interactive)
(switch-to-buffer (get-buffer-create (or buffer "*Custom Theme*"))) (switch-to-buffer (get-buffer-create (or buffer "*Custom Theme*")))
;; Save current faces
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
(erase-buffer)) (erase-buffer)
(dolist (ov (overlays-in (point-min) (point-max)))
(delete-overlay ov)))
(custom-new-theme-mode) (custom-new-theme-mode)
(make-local-variable 'custom-theme-name) (make-local-variable 'custom-theme-name)
(set (make-local-variable 'custom-theme--save-name) theme) (set (make-local-variable 'custom-theme--save-name) theme)
@ -121,50 +123,59 @@ BUFFER, if non-nil, should be a buffer to use."
(widget-create 'push-button (widget-create 'push-button
:notify (function custom-theme-write) :notify (function custom-theme-write)
" Save Theme ") " Save Theme ")
;; Face widgets
(widget-insert "\n\n Theme faces:\n") (let (vars values faces face-specs)
(let (widget)
(dolist (face custom-theme--listed-faces) ;; Load the theme settings.
(widget-insert " ") (when theme
(setq widget (widget-create 'custom-face (load-theme theme t)
:documentation-shown t (dolist (setting (get theme 'theme-settings))
:tag (custom-unlispify-tag-name face) (if (eq (car setting) 'theme-value)
:value face (progn (push (nth 1 setting) vars)
:display-style 'concise (push (nth 3 setting) values))
:custom-state 'hidden (push (nth 1 setting) faces)
:sample-indent 34)) (push (nth 3 setting) face-specs))))
(custom-magic-reset widget)
(push (cons face widget) custom-theme-faces))) ;; If THEME is non-nil, insert all of that theme's faces.
(insert " ") ;; Otherwise, insert those in `custom-theme--listed-faces'.
(setq custom-theme-insert-face-marker (point-marker)) (widget-insert "\n\n Theme faces:\n ")
(insert " ") (if theme
(widget-create 'push-button (while faces
:tag "Insert Additional Face" (custom-theme-add-face-1 (pop faces) (pop face-specs)))
:help-echo "Add another face to this theme." (dolist (face custom-theme--listed-faces)
:follow-link 'mouse-face (custom-theme-add-face-1 face nil)))
:button-face 'custom-link (setq custom-theme-insert-face-marker (point-marker))
:mouse-face 'highlight (widget-insert " ")
:pressed-face 'highlight (widget-create 'push-button
:action (lambda (widget &optional event) :tag "Insert Additional Face"
(call-interactively 'custom-theme-add-face))) :help-echo "Add another face to this theme."
(widget-insert "\n\n Theme variables:\n ") :follow-link 'mouse-face
(setq custom-theme-insert-variable-marker (point-marker)) :button-face 'custom-link
(widget-insert ?\s) :mouse-face 'highlight
(widget-create 'push-button :pressed-face 'highlight
:tag "Insert Variable" :action (lambda (widget &optional event)
:help-echo "Add another variable to this theme." (call-interactively 'custom-theme-add-face)))
:follow-link 'mouse-face
:button-face 'custom-link ;; If THEME is non-nil, insert all of that theme's variables.
:mouse-face 'highlight (widget-insert "\n\n Theme variables:\n ")
:pressed-face 'highlight (if theme
:action (lambda (widget &optional event) (while vars
(call-interactively 'custom-theme-add-variable))) (custom-theme-add-var-1 (pop vars) (pop values))))
(widget-insert ?\n) (setq custom-theme-insert-variable-marker (point-marker))
(if theme (widget-insert " ")
(custom-theme-merge-theme theme)) (widget-create 'push-button
(widget-setup) :tag "Insert Variable"
(goto-char (point-min)) :help-echo "Add another variable to this theme."
(message "")) :follow-link 'mouse-face
:button-face 'custom-link
:mouse-face 'highlight
:pressed-face 'highlight
:action (lambda (widget &optional event)
(call-interactively 'custom-theme-add-variable)))
(widget-insert ?\n)
(widget-setup)
(goto-char (point-min))
(message "")))
(defun custom-theme-revert (ignore-auto noconfirm) (defun custom-theme-revert (ignore-auto noconfirm)
(when (or noconfirm (y-or-n-p "Discard current changes? ")) (when (or noconfirm (y-or-n-p "Discard current changes? "))
@ -172,177 +183,119 @@ BUFFER, if non-nil, should be a buffer to use."
;;; Theme variables ;;; Theme variables
(defun custom-theme-add-variable (symbol) (defun custom-theme-add-variable (var value)
(interactive "vVariable name: ") "Add a widget for VAR (a symbol) to the *New Custom Theme* buffer.
(cond ((assq symbol custom-theme-variables) VALUE should be a value to which to set the widget; when called
(message "%s is already in the theme" (symbol-name symbol))) interactively, this defaults to the current value of VAR."
((not (boundp symbol)) (interactive
(message "%s is not defined as a variable" (symbol-name symbol))) (let ((v (read-variable "Variable name: ")))
((eq symbol 'custom-enabled-themes) (list v (symbol-value v))))
(message "Custom theme cannot contain `custom-enabled-themes'")) (let ((var-and-widget (assq var custom-theme-faces)))
(t (cond ((null var-and-widget)
(save-excursion ;; If VAR is not yet in the buffer, add it.
(goto-char custom-theme-insert-variable-marker) (save-excursion
(widget-insert " ") (goto-char custom-theme-insert-variable-marker)
(let ((widget (widget-create 'custom-variable (custom-theme-add-var-1 var value)
:tag (custom-unlispify-tag-name symbol) (move-marker custom-theme-insert-variable-marker (point))
:custom-level 0 (widget-setup)))
:action 'custom-theme-variable-action ;; Otherwise, alter that var widget.
:custom-state 'unknown (t
:value symbol))) (let ((widget (cdr var-and-widget)))
(push (cons symbol widget) custom-theme-variables) (widget-put widget :shown-value (list value))
(custom-magic-reset widget)) (custom-redraw widget))))))
(widget-insert " ")
(move-marker custom-theme-insert-variable-marker (point))
(widget-setup)))))
(defvar custom-theme-variable-menu (defun custom-theme-add-var-1 (symbol val)
`(("Reset to Current" custom-redraw (widget-insert " ")
(lambda (widget) (push (cons symbol
(and (boundp (widget-value widget)) (widget-create 'custom-variable
(memq (widget-get widget :custom-state) :tag (custom-unlispify-tag-name symbol)
'(themed modified changed))))) :value symbol
("Reset to Theme Value" custom-variable-reset-theme :shown-value (list val)
(lambda (widget) :notify 'ignore
(let ((theme (intern (widget-value custom-theme-name))) :custom-level 0
(symbol (widget-value widget)) :custom-state 'hidden
found) :inhibit-magic t))
(and (custom-theme-p theme) custom-theme-variables)
(dolist (setting (get theme 'theme-settings) found) (widget-insert " "))
(if (and (eq (cadr setting) symbol)
(eq (car setting) 'theme-value))
(setq found t)))))))
("---" ignore ignore)
("Delete" custom-theme-delete-variable nil))
"Alist of actions for the `custom-variable' widget in Custom Theme Mode.
See the documentation for `custom-variable'.")
(defun custom-theme-variable-action (widget &optional event)
"Show the Custom Theme Mode menu for a `custom-variable' widget.
Optional EVENT is the location for the menu."
(let ((custom-variable-menu custom-theme-variable-menu))
(custom-variable-action widget event)))
(defun custom-variable-reset-theme (widget)
"Reset WIDGET to its value for the currently edited theme."
(let ((theme (intern (widget-value custom-theme-name)))
(symbol (widget-value widget))
found)
(dolist (setting (get theme 'theme-settings))
(if (and (eq (cadr setting) symbol)
(eq (car setting) 'theme-value))
(setq found setting)))
(widget-value-set (car (widget-get widget :children))
(nth 3 found)))
(widget-put widget :custom-state 'themed)
(custom-redraw-magic widget)
(widget-setup))
(defun custom-theme-delete-variable (widget)
(setq custom-theme-variables
(assq-delete-all (widget-value widget) custom-theme-variables))
(widget-delete widget))
;;; Theme faces ;;; Theme faces
(defun custom-theme-add-face (symbol) (defun custom-theme-add-face (face &optional spec)
(interactive (list (read-face-name "Face name" nil nil))) "Add a widget for FACE (a symbol) to the *New Custom Theme* buffer.
(cond ((assq symbol custom-theme-faces) SPEC, if non-nil, should be a face spec to which to set the widget."
(message "%s is already in the theme" (symbol-name symbol))) (interactive (list (read-face-name "Face name" nil nil) nil))
((not (facep symbol)) (unless (or (facep face) spec)
(message "%s is not defined as a face" (symbol-name symbol))) (error "`%s' has no face definition" face))
(t (let ((face-and-widget (assq face custom-theme-faces)))
(save-excursion (cond ((null face-and-widget)
(goto-char custom-theme-insert-face-marker) ;; If FACE is not yet in the buffer, add it.
(widget-insert " ") (save-excursion
(let ((widget (widget-create 'custom-face (goto-char custom-theme-insert-face-marker)
:tag (custom-unlispify-tag-name symbol) (custom-theme-add-face-1 face spec)
:custom-level 0
:action 'custom-theme-face-action
:custom-state 'unknown
:display-style 'concise
:sample-indent 34
:value symbol)))
(push (cons symbol widget) custom-theme-faces)
(custom-magic-reset widget)
(widget-insert " ")
(move-marker custom-theme-insert-face-marker (point)) (move-marker custom-theme-insert-face-marker (point))
(widget-setup)))))) (widget-setup)))
;; Otherwise, if SPEC is supplied, alter that face widget.
(spec
(let ((widget (cdr face-and-widget)))
(widget-put widget :shown-value spec)
(custom-redraw widget)))
((called-interactively-p 'interactive)
(error "`%s' is already present" face)))))
(defvar custom-theme-face-menu (defun custom-theme-add-face-1 (symbol spec)
`(("Reset to Theme Value" custom-face-reset-theme (widget-insert " ")
(lambda (widget) (push (cons symbol
(let ((theme (intern (widget-value custom-theme-name))) (widget-create 'custom-face
(symbol (widget-value widget)) :tag (custom-unlispify-tag-name symbol)
found) :documentation-shown t
(and (custom-theme-p theme) :value symbol
(dolist (setting (get theme 'theme-settings) found) :custom-state 'hidden
(if (and (eq (cadr setting) symbol) :display-style 'concise
(eq (car setting) 'theme-face)) :shown-value spec
(setq found t))))))) :inhibit-magic t
("---" ignore ignore) :sample-indent 34))
("Delete" custom-theme-delete-face nil)) custom-theme-faces)
"Alist of actions for the `custom-variable' widget in Custom Theme Mode. (widget-insert " "))
See the documentation for `custom-variable'.")
(defun custom-theme-face-action (widget &optional event)
"Show the Custom Theme Mode menu for a `custom-face' widget.
Optional EVENT is the location for the menu."
(let ((custom-face-menu custom-theme-face-menu))
(custom-face-action widget event)))
(defun custom-face-reset-theme (widget)
"Reset WIDGET to its value for the currently edited theme."
(let ((theme (intern (widget-value custom-theme-name)))
(symbol (widget-value widget))
found)
(dolist (setting (get theme 'theme-settings))
(if (and (eq (cadr setting) symbol)
(eq (car setting) 'theme-face))
(setq found setting)))
(widget-value-set (car (widget-get widget :children))
(nth 3 found)))
(widget-put widget :custom-state 'themed)
(custom-redraw-magic widget)
(widget-setup))
(defun custom-theme-delete-face (widget)
(setq custom-theme-faces
(assq-delete-all (widget-value widget) custom-theme-faces))
(widget-delete widget))
;;; Reading and writing ;;; Reading and writing
(defun custom-theme-visit-theme () (defun custom-theme-visit-theme (theme)
(interactive) "Load the custom theme THEME's settings into the current buffer."
(when (and (y-or-n-p "Discard current changes? ") (interactive
(progn (revert-buffer) t)) (list
(let ((theme (call-interactively 'custom-theme-merge-theme))) (intern (completing-read "Find custom theme: "
(unless (eq theme 'user) (mapcar 'symbol-name
(widget-value-set custom-theme-name (symbol-name theme))) (custom-available-themes))))))
(widget-value-set custom-theme-description (unless (custom-theme-name-valid-p theme)
(or (get theme 'theme-documentation) (error "No valid theme named `%s'" theme))
(format-time-string "Created %Y-%m-%d."))) (cond ((not (eq major-mode 'custom-new-theme-mode))
(widget-setup)))) (customize-create-theme theme))
((y-or-n-p "Discard current changes? ")
(setq custom-theme--save-name theme)
(custom-theme-revert nil t))))
(defun custom-theme-merge-theme (theme) (defun custom-theme-merge-theme (theme)
"Merge the custom theme THEME's settings into the current buffer."
(interactive (interactive
(list (list
(intern (completing-read "Merge custom theme: " (intern (completing-read "Merge custom theme: "
(mapcar 'symbol-name (mapcar 'symbol-name
(custom-available-themes)))))) (custom-available-themes))))))
(unless (custom-theme-name-valid-p theme) (unless (eq theme 'user)
(error "Invalid theme name `%s'" theme)) (unless (custom-theme-name-valid-p theme)
(load-theme theme) (error "Invalid theme name `%s'" theme))
(let ((settings (get theme 'theme-settings))) (load-theme theme t))
(let ((settings (reverse (get theme 'theme-settings))))
(dolist (setting settings) (dolist (setting settings)
(if (eq (car setting) 'theme-value) (funcall (if (eq (car setting) 'theme-value)
(custom-theme-add-variable (cadr setting)) 'custom-theme-add-variable
(custom-theme-add-face (cadr setting))))) 'custom-theme-add-face)
(disable-theme theme) (nth 1 setting)
(nth 3 setting))))
theme) theme)
(defun custom-theme-write (&rest ignore) (defun custom-theme-write (&rest ignore)
"Write the current custom theme to its theme file."
(interactive) (interactive)
(let* ((name (widget-value custom-theme-name)) (let* ((name (widget-value custom-theme-name))
(doc (widget-value custom-theme-description)) (doc (widget-value custom-theme-description))
@ -395,11 +348,12 @@ It includes all variables in list VARS."
(princ "\n") (princ "\n")
(dolist (spec vars) (dolist (spec vars)
(let* ((symbol (car spec)) (let* ((symbol (car spec))
(child (car-safe (widget-get (cdr spec) :children))) (widget (cdr spec))
(child (car-safe (widget-get widget :children)))
(value (if child (value (if child
(widget-value child) (widget-value child)
;; For hidden widgets, use the standard value ;; Child is null if the widget is closed (hidden).
(get symbol 'standard-value)))) (car (widget-get widget :shown-value)))))
(when (boundp symbol) (when (boundp symbol)
(unless (bolp) (unless (bolp)
(princ "\n")) (princ "\n"))
@ -426,30 +380,18 @@ It includes all faces in list FACES."
(dolist (spec faces) (dolist (spec faces)
(let* ((symbol (car spec)) (let* ((symbol (car spec))
(widget (cdr spec)) (widget (cdr spec))
(child (car-safe (widget-get widget :children)))
(state (if child
(widget-get widget :custom-state)
(custom-face-state symbol)))
(value (value
(cond ((eq state 'standard) (if (car-safe (widget-get widget :children))
nil) ; do nothing (custom-face-widget-to-spec widget)
(child ;; Child is null if the widget is closed (hidden).
(custom-face-widget-to-spec widget)) (widget-get widget :shown-value))))
(t
;; Widget is closed (hidden), but the face has
;; a non-standard value. Try to extract that
;; value and save it.
(custom-face-get-current-spec symbol)))))
(when (and (facep symbol) value) (when (and (facep symbol) value)
(if (bolp) (princ (if (bolp) " '(" "\n '("))
(princ " '(")
(princ "\n '("))
(prin1 symbol) (prin1 symbol)
(princ " ") (princ " ")
(prin1 value) (prin1 value)
(princ ")")))) (princ ")"))))
(if (bolp) (if (bolp) (princ " "))
(princ " "))
(princ ")") (princ ")")
(unless (looking-at "\n") (unless (looking-at "\n")
(princ "\n"))))) (princ "\n")))))
@ -587,6 +529,19 @@ Theme files are named *-theme.el in `"))
:action (lambda (widget &rest ignore) :action (lambda (widget &rest ignore)
(describe-variable 'load-path))) (describe-variable 'load-path)))
(widget-insert "'.\n\n") (widget-insert "'.\n\n")
;; If the user has made customizations, display a warning and
;; provide buttons to disable or convert them.
(let ((user-settings (get 'user 'theme-settings)))
(unless (or (null user-settings)
(and (null (cdr user-settings))
(eq (caar user-settings) 'theme-value)
(eq (cadr (car user-settings)) 'custom-enabled-themes)))
(widget-insert "Note: Your custom settings take precedence over theme settings.\n\n")
;; FIXME: Provide some way to painlessly disable or migrate
;; these settings.
))
(widget-create 'push-button (widget-create 'push-button
:tag " Save Theme Settings " :tag " Save Theme Settings "
:help-echo "Save the selected themes for future sessions." :help-echo "Save the selected themes for future sessions."