]> git.eshelyaron.com Git - emacs.git/commitdiff
* cus-edit.el (custom-face-set): Call custom-push-theme before
authorChong Yidong <cyd@stupidchicken.com>
Tue, 21 Mar 2006 16:44:10 +0000 (16:44 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 21 Mar 2006 16:44:10 +0000 (16:44 +0000)
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.

lisp/ChangeLog
lisp/cus-edit.el
lisp/custom.el

index 22a05486c9efeea567fdb4ed6da0bc60ee609764..acfc4975c54e3b28006f10abfc87722f985d7337 100644 (file)
@@ -1,3 +1,13 @@
+2006-03-21  Chong Yidong  <cyd@stupidchicken.com>
+
+       * 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.
+
 2006-03-21  Simon Josefsson  <jas@extundo.com>
 
        * pgg-gpg.el: Ideas below based on patch from Sascha Wilde
index 74e63454ad9a7cefd5388a12de952c321cd045cd..e2275ce356d346e42723089bb72d8cbb8d5d9d12 100644 (file)
@@ -3412,12 +3412,12 @@ Optional EVENT is the location for the menu."
       ;; Make the comment invisible by hand if it's empty
       (custom-comment-hide comment-widget))
     (put symbol 'customized-face value)
+    (custom-push-theme 'theme-face symbol 'user 'set value)
     (if (face-spec-choose value)
        (face-spec-set symbol value)
       ;; face-set-spec ignores empty attribute lists, so just give it
       ;; something harmless instead.
       (face-spec-set symbol '((t :foreground unspecified))))
-    (custom-push-theme 'theme-face symbol 'user 'set value)
     (put symbol 'customized-face-comment comment)
     (put symbol 'face-comment comment)
     (custom-face-state-set widget)
@@ -3490,13 +3490,17 @@ restoring it to the state of a face that has never been customized."
     (put symbol 'customized-face nil)
     (put symbol 'customized-face-comment nil)
     (custom-push-theme 'theme-face symbol 'user 'reset)
+    (face-spec-set symbol value)
     (custom-theme-recalc-face symbol)
     (when (or (get symbol 'saved-face) (get symbol 'saved-face-comment))
       (put symbol 'saved-face nil)
       (put symbol 'saved-face-comment nil)
       (custom-save-all))
     (put symbol 'face-comment nil)
-    (widget-value-set child value)
+    (widget-value-set child
+                     (custom-pre-filter-face-spec
+                      (list (list t (custom-face-attributes-get
+                                     symbol nil)))))
     ;; This call manages the comment visibility
     (widget-value-set comment-widget "")
     (custom-face-state-set widget)
index 15b5b4a815c9175f08cc1cd0a15fd59d6f9ae5b4..c67f3b06272f62821e8b10e580022fc80425d652 100644 (file)
@@ -819,7 +819,8 @@ See `custom-known-themes' for a list of known themes."
                         (not (equal (eval (car (get symbol 'standard-value)))
                                     (symbol-value symbol)))))
                (setq old (list (list 'changed (symbol-value symbol))))
-             (if (facep symbol)
+             (if (and (facep symbol)
+                      (not (face-spec-match-p symbol (get symbol 'face-defface-spec))))
                  (setq old (list (list 'changed (list
                    (append '(t) (custom-face-attributes-get symbol nil)))))))))
        (put symbol prop (cons (list theme value) old))