Mercurial > emacs
comparison lisp/cus-edit.el @ 69624:efd1add5bedf
* cus-edit.el (custom-face-set): Call custom-push-theme before
face-spec set so that `changed' theme is correctly saved.
(custom-face-reset-standard): Reset to recalculated face rather
than defface spec.
* custom.el (custom-push-theme): Only save `changed' theme if the
current face does not match the defface specs.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Tue, 21 Mar 2006 16:44:10 +0000 |
parents | a22167168ac4 |
children | dc1f0ab7e276 e6bf73e43cf4 |
comparison
equal
deleted
inserted
replaced
69623:a80a437040ab | 69624:efd1add5bedf |
---|---|
3410 (when (equal comment "") | 3410 (when (equal comment "") |
3411 (setq comment nil) | 3411 (setq comment nil) |
3412 ;; Make the comment invisible by hand if it's empty | 3412 ;; Make the comment invisible by hand if it's empty |
3413 (custom-comment-hide comment-widget)) | 3413 (custom-comment-hide comment-widget)) |
3414 (put symbol 'customized-face value) | 3414 (put symbol 'customized-face value) |
3415 (custom-push-theme 'theme-face symbol 'user 'set value) | |
3415 (if (face-spec-choose value) | 3416 (if (face-spec-choose value) |
3416 (face-spec-set symbol value) | 3417 (face-spec-set symbol value) |
3417 ;; face-set-spec ignores empty attribute lists, so just give it | 3418 ;; face-set-spec ignores empty attribute lists, so just give it |
3418 ;; something harmless instead. | 3419 ;; something harmless instead. |
3419 (face-spec-set symbol '((t :foreground unspecified)))) | 3420 (face-spec-set symbol '((t :foreground unspecified)))) |
3420 (custom-push-theme 'theme-face symbol 'user 'set value) | |
3421 (put symbol 'customized-face-comment comment) | 3421 (put symbol 'customized-face-comment comment) |
3422 (put symbol 'face-comment comment) | 3422 (put symbol 'face-comment comment) |
3423 (custom-face-state-set widget) | 3423 (custom-face-state-set widget) |
3424 (custom-redraw-magic widget))) | 3424 (custom-redraw-magic widget))) |
3425 | 3425 |
3488 (unless value | 3488 (unless value |
3489 (error "No standard setting for this face")) | 3489 (error "No standard setting for this face")) |
3490 (put symbol 'customized-face nil) | 3490 (put symbol 'customized-face nil) |
3491 (put symbol 'customized-face-comment nil) | 3491 (put symbol 'customized-face-comment nil) |
3492 (custom-push-theme 'theme-face symbol 'user 'reset) | 3492 (custom-push-theme 'theme-face symbol 'user 'reset) |
3493 (face-spec-set symbol value) | |
3493 (custom-theme-recalc-face symbol) | 3494 (custom-theme-recalc-face symbol) |
3494 (when (or (get symbol 'saved-face) (get symbol 'saved-face-comment)) | 3495 (when (or (get symbol 'saved-face) (get symbol 'saved-face-comment)) |
3495 (put symbol 'saved-face nil) | 3496 (put symbol 'saved-face nil) |
3496 (put symbol 'saved-face-comment nil) | 3497 (put symbol 'saved-face-comment nil) |
3497 (custom-save-all)) | 3498 (custom-save-all)) |
3498 (put symbol 'face-comment nil) | 3499 (put symbol 'face-comment nil) |
3499 (widget-value-set child value) | 3500 (widget-value-set child |
3501 (custom-pre-filter-face-spec | |
3502 (list (list t (custom-face-attributes-get | |
3503 symbol nil))))) | |
3500 ;; This call manages the comment visibility | 3504 ;; This call manages the comment visibility |
3501 (widget-value-set comment-widget "") | 3505 (widget-value-set comment-widget "") |
3502 (custom-face-state-set widget) | 3506 (custom-face-state-set widget) |
3503 (custom-redraw-magic widget))) | 3507 (custom-redraw-magic widget))) |
3504 | 3508 |