]> git.eshelyaron.com Git - emacs.git/commitdiff
Custom Theme bugfixes.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 5 Sep 2005 19:50:02 +0000 (19:50 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 5 Sep 2005 19:50:02 +0000 (19:50 +0000)
lisp/ChangeLog
lisp/cus-theme.el
lisp/custom.el

index a24c34c94612960449eba37f9dc37c72df1c0973..6ad9d6e4d9b9b3f190d37afaa6b3c7453ea35a12 100644 (file)
@@ -1,3 +1,15 @@
+2005-09-05  Chong Yidong  <cyd@stupidchicken.com>
+
+       * cus-theme.el (custom-theme-write-faces): Save the current face
+       spec, not the defface spec.
+
+       * custom.el (custom-known-themes): Clarify meaning of "standard".
+       (custom-push-theme): Save old values in the standard theme.
+       (disable-theme): Correct typo.
+       (custom-face-theme-value) Deleted unused function.
+       (custom-theme-recalc-face): Rewritten to treat enable/disable
+       properly.
+
 2005-09-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/compile.el (compilation-goto-locus): Take into account
index 95a0a4b2896157cff89648b0edc0d7586c3649b7..43cf96e34fa14f9392201426477e64745fb00e50 100644 (file)
@@ -168,8 +168,9 @@ It includes all faces in list FACES."
                (princ " '(")
                (prin1 symbol)
                (princ " ")
-               (prin1 (or (get symbol 'customized-face)
-                          (get symbol 'face-defface-spec)))
+               (prin1 (list (append '(t)
+                                    (custom-face-attributes-get
+                                     'font-lock-comment-face nil))))
                (princ ")")))
              faces)
       (if (bolp)
index c4eae52751b6ef6e15048c99e6f6ee973d1587ce..2b714a7b458adbcc5fa0c28f57fd80425a3599bd 100644 (file)
@@ -583,7 +583,7 @@ This recursively follows aliases."
 (defvar custom-known-themes '(user standard)
    "Themes that have been defined with `deftheme'.
 The default value is the list (user standard).  The theme `standard'
-contains the Emacs standard settings from the original Lisp files.  The
+contains the settings before custom themes are applied.  The
 theme `user' contains all the settings the user customized and saved.
 Additional themes declared with the `deftheme' macro will be added to
 the front of this list.")
@@ -649,6 +649,16 @@ See `custom-known-themes' for a list of known themes."
        (progn
          (setcar (cdr setting) mode)
          (setcar (cddr setting) value))
+      (if (null old)
+         (setq old
+               (list
+                (list 'standard 'set
+                      (if (eq prop 'theme-value)
+                          (symbol-value symbol)
+                        (list
+                         (append
+                          '(t)
+                          (custom-face-attributes-get symbol nil))))))))
       (put symbol prop (cons (list theme mode value) old)))
     ;; Record, for each theme, all its settings.
     (put theme 'theme-settings
@@ -1117,7 +1127,7 @@ See `custom-known-themes' for a list of known themes."
       (let* ((prop (car s))
             (symbol (cadr s))
             (spec-list (get symbol prop)))
-       (put symbol 'theme-value (assq-delete-all theme spec-list))
+       (put symbol prop (assq-delete-all theme spec-list))
        (if (eq prop 'theme-value)
            (custom-theme-recalc-variable symbol)
          (custom-theme-recalc-face symbol)))))
@@ -1156,13 +1166,6 @@ This function returns nil if no custom theme specifies a value for VARIABLE."
     (if theme-value
        (custom-theme-value (car (car theme-value)) theme-value))))
 
-(defun custom-face-theme-value (face)
-  "Return the face spec of FACE according to currently enabled custom themes.
-This function returns nil if no custom theme specifies anything for FACE."
-  (let* ((theme-value (get face 'theme-face)))
-    (if theme-value
-       (custom-theme-value (car (car theme-value)) theme-value))))
-
 (defun custom-theme-recalc-variable (variable)
   "Set VARIABLE according to currently enabled custom themes."
   (let ((valspec (custom-variable-theme-value variable)))
@@ -1177,16 +1180,9 @@ This function returns nil if no custom theme specifies anything for FACE."
 
 (defun custom-theme-recalc-face (face)
   "Set FACE according to currently enabled custom themes."
-  (let ((spec (custom-face-theme-value face)))
-    (when spec
-      (put face 'save-face spec))
-    (unless spec
-      (setq spec (get face 'face-defface-spec)))
-    (when spec
-      (when (or (get face 'force-face) (facep face))
-       (unless (facep face)
-         (make-empty-face face))
-       (face-spec-set face spec)))))
+  (let ((theme-faces (reverse (get face 'theme-face))))
+    (dolist (spec theme-faces)
+      (face-spec-set face (car (cddr spec))))))
 \f
 (defun custom-theme-reset-variables (theme &rest args)
   "Reset the specs in THEME of some variables to their values in other themes.