diff options
Diffstat (limited to 'lisp/cus-theme.el')
| -rw-r--r-- | lisp/cus-theme.el | 17 |
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. |
| 83 | THEME, if non-nil, should be an existing theme to edit. If THEME | 83 | THEME, if non-nil, should be an existing theme to edit. If THEME |
| 84 | is `user', provide an option to remove these as custom settings. | 84 | is `user', the resulting *Custom Theme* buffer also contains a |
| 85 | checkbox for removing the theme settings specified in the buffer | ||
| 86 | from the Custom save file. | ||
| 85 | BUFFER, if non-nil, should be a buffer to use; the default is | 87 | BUFFER, if non-nil, should be a buffer to use; the default is |
| 86 | named *Custom Theme*." | 88 | named *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. | ||
| 215 | This 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) |