From: Chong Yidong Date: Mon, 5 Sep 2005 19:50:02 +0000 (+0000) Subject: Custom Theme bugfixes. X-Git-Tag: emacs-pretest-22.0.90~7252 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=79a0aa117492468055f2b07f40e24355689b3030;p=emacs.git Custom Theme bugfixes. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a24c34c9461..6ad9d6e4d9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2005-09-05 Chong Yidong + + * 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 * progmodes/compile.el (compilation-goto-locus): Take into account diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 95a0a4b2896..43cf96e34fa 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -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) diff --git a/lisp/custom.el b/lisp/custom.el index c4eae52751b..2b714a7b458 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -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)))))) (defun custom-theme-reset-variables (theme &rest args) "Reset the specs in THEME of some variables to their values in other themes.