aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cus-theme.el
diff options
context:
space:
mode:
authorJoakim Verona2012-03-25 22:04:52 +0200
committerJoakim Verona2012-03-25 22:04:52 +0200
commit75da28a3845b9dfa4e730cfa19c14edc52cbb222 (patch)
treeb04519bffcb21264cbe3ce8af13df7186548667f /lisp/cus-theme.el
parentb827329a89291ed68dd017c53976be7ce5ed3b22 (diff)
parentf514f6f0e3f8bbeb5212d0337e5bda5a9a4eaeb5 (diff)
downloademacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.tar.gz
emacs-75da28a3845b9dfa4e730cfa19c14edc52cbb222.zip
upstream
Diffstat (limited to 'lisp/cus-theme.el')
-rw-r--r--lisp/cus-theme.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 79799049378..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.
83THEME, if non-nil, should be an existing theme to edit. If THEME 83THEME, if non-nil, should be an existing theme to edit. If THEME
84is `user', provide an option to remove these as custom settings. 84is `user', the resulting *Custom Theme* buffer also contains a
85checkbox for removing the theme settings specified in the buffer
86from the Custom save file.
85BUFFER, if non-nil, should be a buffer to use; the default is 87BUFFER, if non-nil, should be a buffer to use; the default is
86named *Custom Theme*." 88named *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.
215This 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
@@ -437,14 +441,17 @@ It includes all faces in list FACES."
437 (princ theme) 441 (princ theme)
438 (princ "\n") 442 (princ "\n")
439 (dolist (spec faces) 443 (dolist (spec faces)
444 ;; Insert the face iff the checkbox widget is checked.
440 (when (widget-get (nth 1 spec) :value) 445 (when (widget-get (nth 1 spec) :value)
441 (let* ((symbol (nth 0 spec)) 446 (let* ((symbol (nth 0 spec))
442 (widget (nth 2 spec)) 447 (widget (nth 2 spec))
443 (value 448 (value
444 (if (car-safe (widget-get widget :children)) 449 (cond
445 (custom-face-widget-to-spec widget) 450 ((car-safe (widget-get widget :children))
446 ;; Child is null if the widget is closed (hidden). 451 (custom-face-widget-to-spec widget))
447 (widget-get widget :shown-value)))) 452 ;; Child is null if the widget is closed (hidden).
453 ((widget-get widget :shown-value))
454 (t (custom-face-get-current-spec symbol)))))
448 (when (and (facep symbol) value) 455 (when (and (facep symbol) value)
449 (princ (if (bolp) " '(" "\n '(")) 456 (princ (if (bolp) " '(" "\n '("))
450 (prin1 symbol) 457 (prin1 symbol)