Mercurial > emacs
comparison lisp/cus-edit.el @ 35441:d85fe63db92b
(custom-face-save): Do post-processing on the face's new value like
`custom-face-set' does.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 20 Jan 2001 01:24:15 +0000 |
parents | 71b043afa1da |
children | d1106e82508b |
comparison
equal
deleted
inserted
replaced
35440:21817d18668c | 35441:d85fe63db92b |
---|---|
2871 | 2871 |
2872 (defun custom-face-save (widget) | 2872 (defun custom-face-save (widget) |
2873 "Prepare for saving WIDGET's face attributes, but don't write `.emacs'." | 2873 "Prepare for saving WIDGET's face attributes, but don't write `.emacs'." |
2874 (let* ((symbol (widget-value widget)) | 2874 (let* ((symbol (widget-value widget)) |
2875 (child (car (widget-get widget :children))) | 2875 (child (car (widget-get widget :children))) |
2876 (value (widget-value child)) | 2876 (value (custom-post-filter-face-spec (widget-value child))) |
2877 (comment-widget (widget-get widget :comment-widget)) | 2877 (comment-widget (widget-get widget :comment-widget)) |
2878 (comment (widget-value comment-widget))) | 2878 (comment (widget-value comment-widget))) |
2879 (when (equal comment "") | 2879 (when (equal comment "") |
2880 (setq comment nil) | 2880 (setq comment nil) |
2881 ;; Make the comment invisible by hand if it's empty | 2881 ;; Make the comment invisible by hand if it's empty |
2882 (custom-comment-hide comment-widget)) | 2882 (custom-comment-hide comment-widget)) |
2883 (face-spec-set symbol value) | 2883 (if (face-spec-choose value) |
2884 (face-spec-set symbol value) | |
2885 ;; face-set-spec ignores empty attribute lists, so just give it | |
2886 ;; something harmless instead. | |
2887 (face-spec-set symbol '((t :foreground unspecified)))) | |
2884 (put symbol 'saved-face value) | 2888 (put symbol 'saved-face value) |
2885 (put symbol 'customized-face nil) | 2889 (put symbol 'customized-face nil) |
2886 (put symbol 'face-comment comment) | 2890 (put symbol 'face-comment comment) |
2887 (put symbol 'customized-face-comment nil) | 2891 (put symbol 'customized-face-comment nil) |
2888 (put symbol 'saved-face-comment comment) | 2892 (put symbol 'saved-face-comment comment) |