+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
(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.")
(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
(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)))))
(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)))
(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.