583 |
(defvar custom-known-themes '(user standard) |
(defvar custom-known-themes '(user standard) |
584 |
"Themes that have been defined with `deftheme'. |
"Themes that have been defined with `deftheme'. |
585 |
The default value is the list (user standard). The theme `standard' |
The default value is the list (user standard). The theme `standard' |
586 |
contains the Emacs standard settings from the original Lisp files. The |
contains the settings before custom themes are applied. The |
587 |
theme `user' contains all the settings the user customized and saved. |
theme `user' contains all the settings the user customized and saved. |
588 |
Additional themes declared with the `deftheme' macro will be added to |
Additional themes declared with the `deftheme' macro will be added to |
589 |
the front of this list.") |
the front of this list.") |
649 |
(progn |
(progn |
650 |
(setcar (cdr setting) mode) |
(setcar (cdr setting) mode) |
651 |
(setcar (cddr setting) value)) |
(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)))))))) |
662 |
(put symbol prop (cons (list theme mode value) old))) |
(put symbol prop (cons (list theme mode value) old))) |
663 |
;; Record, for each theme, all its settings. |
;; Record, for each theme, all its settings. |
664 |
(put theme 'theme-settings |
(put theme 'theme-settings |
1127 |
(let* ((prop (car s)) |
(let* ((prop (car s)) |
1128 |
(symbol (cadr s)) |
(symbol (cadr s)) |
1129 |
(spec-list (get symbol prop))) |
(spec-list (get symbol prop))) |
1130 |
(put symbol 'theme-value (assq-delete-all theme spec-list)) |
(put symbol prop (assq-delete-all theme spec-list)) |
1131 |
(if (eq prop 'theme-value) |
(if (eq prop 'theme-value) |
1132 |
(custom-theme-recalc-variable symbol) |
(custom-theme-recalc-variable symbol) |
1133 |
(custom-theme-recalc-face symbol))))) |
(custom-theme-recalc-face symbol))))) |
1166 |
(if theme-value |
(if theme-value |
1167 |
(custom-theme-value (car (car theme-value)) theme-value)))) |
(custom-theme-value (car (car theme-value)) theme-value)))) |
1168 |
|
|
|
(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)))) |
|
|
|
|
1169 |
(defun custom-theme-recalc-variable (variable) |
(defun custom-theme-recalc-variable (variable) |
1170 |
"Set VARIABLE according to currently enabled custom themes." |
"Set VARIABLE according to currently enabled custom themes." |
1171 |
(let ((valspec (custom-variable-theme-value variable))) |
(let ((valspec (custom-variable-theme-value variable))) |
1180 |
|
|
1181 |
(defun custom-theme-recalc-face (face) |
(defun custom-theme-recalc-face (face) |
1182 |
"Set FACE according to currently enabled custom themes." |
"Set FACE according to currently enabled custom themes." |
1183 |
(let ((spec (custom-face-theme-value face))) |
(let ((theme-faces (reverse (get face 'theme-face)))) |
1184 |
(when spec |
(dolist (spec theme-faces) |
1185 |
(put face 'save-face spec)) |
(face-spec-set face (car (cddr 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))))) |
|
1186 |
|
|
1187 |
(defun custom-theme-reset-variables (theme &rest args) |
(defun custom-theme-reset-variables (theme &rest args) |
1188 |
"Reset the specs in THEME of some variables to their values in other themes. |
"Reset the specs in THEME of some variables to their values in other themes. |