aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-03-21 16:44:10 +0000
committerChong Yidong2006-03-21 16:44:10 +0000
commite02577b7d8dc9e9384b0e27edf992a5606b81465 (patch)
tree2a1e6343be9eb706805d96279b86817eab4e3da0
parent11e887e29ed7373ecda47ae4956c1752b47c8c98 (diff)
downloademacs-e02577b7d8dc9e9384b0e27edf992a5606b81465.tar.gz
emacs-e02577b7d8dc9e9384b0e27edf992a5606b81465.zip
* 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.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/cus-edit.el8
-rw-r--r--lisp/custom.el3
3 files changed, 18 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 22a05486c9e..acfc4975c54 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12006-03-21 Chong Yidong <cyd@stupidchicken.com>
2
3 * cus-edit.el (custom-face-set): Call custom-push-theme before
4 face-spec set so that `changed' theme is correctly saved.
5 (custom-face-reset-standard): Reset to recalculated face rather
6 than defface spec.
7
8 * custom.el (custom-push-theme): Only save `changed' theme if the
9 current face does not match the defface specs.
10
12006-03-21 Simon Josefsson <jas@extundo.com> 112006-03-21 Simon Josefsson <jas@extundo.com>
2 12
3 * pgg-gpg.el: Ideas below based on patch from Sascha Wilde 13 * pgg-gpg.el: Ideas below based on patch from Sascha Wilde
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 74e63454ad9..e2275ce356d 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3412,12 +3412,12 @@ Optional EVENT is the location for the menu."
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)
@@ -3490,13 +3490,17 @@ restoring it to the state of a face that has never been customized."
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)
diff --git a/lisp/custom.el b/lisp/custom.el
index 15b5b4a815c..c67f3b06272 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -819,7 +819,8 @@ See `custom-known-themes' for a list of known themes."
819 (not (equal (eval (car (get symbol 'standard-value))) 819 (not (equal (eval (car (get symbol 'standard-value)))
820 (symbol-value symbol))))) 820 (symbol-value symbol)))))
821 (setq old (list (list 'changed (symbol-value symbol)))) 821 (setq old (list (list 'changed (symbol-value symbol))))
822 (if (facep symbol) 822 (if (and (facep symbol)
823 (not (face-spec-match-p symbol (get symbol 'face-defface-spec))))
823 (setq old (list (list 'changed (list 824 (setq old (list (list 'changed (list
824 (append '(t) (custom-face-attributes-get symbol nil))))))))) 825 (append '(t) (custom-face-attributes-get symbol nil)))))))))
825 (put symbol prop (cons (list theme value) old)) 826 (put symbol prop (cons (list theme value) old))