aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2005-09-05 19:50:02 +0000
committerChong Yidong2005-09-05 19:50:02 +0000
commit79a0aa117492468055f2b07f40e24355689b3030 (patch)
tree5a8213a51aa934fce8063374057ef452dc0f6ed1 /lisp
parentc9ac21eb0d8fa6ad3153e74fce8b6ed5dc7588db (diff)
downloademacs-79a0aa117492468055f2b07f40e24355689b3030.tar.gz
emacs-79a0aa117492468055f2b07f40e24355689b3030.zip
Custom Theme bugfixes.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/cus-theme.el5
-rw-r--r--lisp/custom.el34
3 files changed, 30 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a24c34c9461..6ad9d6e4d9b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12005-09-05 Chong Yidong <cyd@stupidchicken.com>
2
3 * cus-theme.el (custom-theme-write-faces): Save the current face
4 spec, not the defface spec.
5
6 * custom.el (custom-known-themes): Clarify meaning of "standard".
7 (custom-push-theme): Save old values in the standard theme.
8 (disable-theme): Correct typo.
9 (custom-face-theme-value) Deleted unused function.
10 (custom-theme-recalc-face): Rewritten to treat enable/disable
11 properly.
12
12005-09-05 Stefan Monnier <monnier@iro.umontreal.ca> 132005-09-05 Stefan Monnier <monnier@iro.umontreal.ca>
2 14
3 * progmodes/compile.el (compilation-goto-locus): Take into account 15 * 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."
168 (princ " '(") 168 (princ " '(")
169 (prin1 symbol) 169 (prin1 symbol)
170 (princ " ") 170 (princ " ")
171 (prin1 (or (get symbol 'customized-face) 171 (prin1 (list (append '(t)
172 (get symbol 'face-defface-spec))) 172 (custom-face-attributes-get
173 'font-lock-comment-face nil))))
173 (princ ")"))) 174 (princ ")")))
174 faces) 175 faces)
175 (if (bolp) 176 (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."
583(defvar custom-known-themes '(user standard) 583(defvar custom-known-themes '(user standard)
584 "Themes that have been defined with `deftheme'. 584 "Themes that have been defined with `deftheme'.
585The default value is the list (user standard). The theme `standard' 585The default value is the list (user standard). The theme `standard'
586contains the Emacs standard settings from the original Lisp files. The 586contains the settings before custom themes are applied. The
587theme `user' contains all the settings the user customized and saved. 587theme `user' contains all the settings the user customized and saved.
588Additional themes declared with the `deftheme' macro will be added to 588Additional themes declared with the `deftheme' macro will be added to
589the front of this list.") 589the front of this list.")
@@ -649,6 +649,16 @@ See `custom-known-themes' for a list of known themes."
649 (progn 649 (progn
650 (setcar (cdr setting) mode) 650 (setcar (cdr setting) mode)
651 (setcar (cddr setting) value)) 651 (setcar (cddr setting) value))
652 (if (null old)
653 (setq old
654 (list
655 (list 'standard 'set
656 (if (eq prop 'theme-value)
657 (symbol-value symbol)
658 (list
659 (append
660 '(t)
661 (custom-face-attributes-get symbol nil))))))))
652 (put symbol prop (cons (list theme mode value) old))) 662 (put symbol prop (cons (list theme mode value) old)))
653 ;; Record, for each theme, all its settings. 663 ;; Record, for each theme, all its settings.
654 (put theme 'theme-settings 664 (put theme 'theme-settings
@@ -1117,7 +1127,7 @@ See `custom-known-themes' for a list of known themes."
1117 (let* ((prop (car s)) 1127 (let* ((prop (car s))
1118 (symbol (cadr s)) 1128 (symbol (cadr s))
1119 (spec-list (get symbol prop))) 1129 (spec-list (get symbol prop)))
1120 (put symbol 'theme-value (assq-delete-all theme spec-list)) 1130 (put symbol prop (assq-delete-all theme spec-list))
1121 (if (eq prop 'theme-value) 1131 (if (eq prop 'theme-value)
1122 (custom-theme-recalc-variable symbol) 1132 (custom-theme-recalc-variable symbol)
1123 (custom-theme-recalc-face symbol))))) 1133 (custom-theme-recalc-face symbol)))))
@@ -1156,13 +1166,6 @@ This function returns nil if no custom theme specifies a value for VARIABLE."
1156 (if theme-value 1166 (if theme-value
1157 (custom-theme-value (car (car theme-value)) theme-value)))) 1167 (custom-theme-value (car (car theme-value)) theme-value))))
1158 1168
1159(defun custom-face-theme-value (face)
1160 "Return the face spec of FACE according to currently enabled custom themes.
1161This function returns nil if no custom theme specifies anything for FACE."
1162 (let* ((theme-value (get face 'theme-face)))
1163 (if theme-value
1164 (custom-theme-value (car (car theme-value)) theme-value))))
1165
1166(defun custom-theme-recalc-variable (variable) 1169(defun custom-theme-recalc-variable (variable)
1167 "Set VARIABLE according to currently enabled custom themes." 1170 "Set VARIABLE according to currently enabled custom themes."
1168 (let ((valspec (custom-variable-theme-value variable))) 1171 (let ((valspec (custom-variable-theme-value variable)))
@@ -1177,16 +1180,9 @@ This function returns nil if no custom theme specifies anything for FACE."
1177 1180
1178(defun custom-theme-recalc-face (face) 1181(defun custom-theme-recalc-face (face)
1179 "Set FACE according to currently enabled custom themes." 1182 "Set FACE according to currently enabled custom themes."
1180 (let ((spec (custom-face-theme-value face))) 1183 (let ((theme-faces (reverse (get face 'theme-face))))
1181 (when spec 1184 (dolist (spec theme-faces)
1182 (put face 'save-face spec)) 1185 (face-spec-set face (car (cddr spec))))))
1183 (unless spec
1184 (setq spec (get face 'face-defface-spec)))
1185 (when spec
1186 (when (or (get face 'force-face) (facep face))
1187 (unless (facep face)
1188 (make-empty-face face))
1189 (face-spec-set face spec)))))
1190 1186
1191(defun custom-theme-reset-variables (theme &rest args) 1187(defun custom-theme-reset-variables (theme &rest args)
1192 "Reset the specs in THEME of some variables to their values in other themes. 1188 "Reset the specs in THEME of some variables to their values in other themes.