Mercurial > emacs
comparison lisp/custom.el @ 67943:6130ad6751ca
(custom-load-themes): Function deleted.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 30 Dec 2005 22:58:15 +0000 |
parents | 8eec4e57f170 |
children | 415ebc0554de |
comparison
equal
deleted
inserted
replaced
67942:8170e87ad98f | 67943:6130ad6751ca |
---|---|
1055 (defun custom-theme-enabled-p (theme) | 1055 (defun custom-theme-enabled-p (theme) |
1056 "Return non-nil if THEME is enabled." | 1056 "Return non-nil if THEME is enabled." |
1057 (memq theme custom-enabled-themes)) | 1057 (memq theme custom-enabled-themes)) |
1058 | 1058 |
1059 (defun provide-theme (theme) | 1059 (defun provide-theme (theme) |
1060 "Indicate that this file provides THEME. | 1060 "Indicate that this file provides THEME, and mark it as enabled. |
1061 Add THEME to `custom-loaded-themes', and `provide' whatever | 1061 Add THEME to `custom-loaded-themes' and `custom-enabled-themes', |
1062 feature name is stored in THEME's property `theme-feature'. | 1062 and `provide' the feature name stored in THEME's property `theme-feature'. |
1063 | 1063 |
1064 Usually the `theme-feature' property contains a symbol created | 1064 Usually the `theme-feature' property contains a symbol created |
1065 by `custom-make-theme-feature'." | 1065 by `custom-make-theme-feature'." |
1066 (custom-check-theme theme) | 1066 (custom-check-theme theme) |
1067 (provide (get theme 'theme-feature)) | 1067 (provide (get theme 'theme-feature)) |
1136 | 1136 |
1137 This signals an error if THEME does not specify any theme | 1137 This signals an error if THEME does not specify any theme |
1138 settings. Theme settings are set using `load-theme'." | 1138 settings. Theme settings are set using `load-theme'." |
1139 (interactive "SEnable Custom theme: ") | 1139 (interactive "SEnable Custom theme: ") |
1140 (let ((settings (get theme 'theme-settings))) | 1140 (let ((settings (get theme 'theme-settings))) |
1141 (if (and (not (eq theme 'user)) (null settings)) | 1141 (unless (or (eq theme 'user) (memq theme custom-loaded-themes)) |
1142 (error "No theme settings defined in %s." (symbol-name theme))) | 1142 (error "Theme %s not defined" (symbol-name theme))) |
1143 (dolist (s settings) | 1143 (dolist (s settings) |
1144 (let* ((prop (car s)) | 1144 (let* ((prop (car s)) |
1145 (symbol (cadr s)) | 1145 (symbol (cadr s)) |
1146 (spec-list (get symbol prop))) | 1146 (spec-list (get symbol prop))) |
1147 (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) | 1147 (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) |
1155 (unless (eq theme 'user) | 1155 (unless (eq theme 'user) |
1156 (enable-theme 'user))) | 1156 (enable-theme 'user))) |
1157 | 1157 |
1158 (defun disable-theme (theme) | 1158 (defun disable-theme (theme) |
1159 "Disable all variable and face settings defined by THEME. | 1159 "Disable all variable and face settings defined by THEME. |
1160 See `custom-known-themes' for a list of known themes." | 1160 See `custom-enabled-themes' for a list of known themes." |
1161 (interactive "SDisable Custom theme: ") | 1161 (interactive "SDisable Custom theme: ") |
1162 (let ((settings (get theme 'theme-settings))) | 1162 (when (memq theme custom-enabled-themes) |
1163 (dolist (s settings) | 1163 (let ((settings (get theme 'theme-settings))) |
1164 (let* ((prop (car s)) | 1164 (dolist (s settings) |
1165 (symbol (cadr s)) | 1165 (let* ((prop (car s)) |
1166 (spec-list (get symbol prop))) | 1166 (symbol (cadr s)) |
1167 (put symbol prop (assq-delete-all theme spec-list)) | 1167 (spec-list (get symbol prop))) |
1168 (if (eq prop 'theme-value) | 1168 (put symbol prop (assq-delete-all theme spec-list)) |
1169 (custom-theme-recalc-variable symbol) | 1169 (if (eq prop 'theme-value) |
1170 (custom-theme-recalc-face symbol))))) | 1170 (custom-theme-recalc-variable symbol) |
1171 (custom-theme-recalc-face symbol)))))) | |
1171 (setq custom-enabled-themes | 1172 (setq custom-enabled-themes |
1172 (delq theme custom-enabled-themes))) | 1173 (delq theme custom-enabled-themes))) |
1173 | 1174 |
1174 (defun custom-theme-value (theme setting-list) | 1175 (defun custom-theme-value (theme setting-list) |
1175 "Determine the value specified for THEME according to SETTING-LIST. | 1176 "Determine the value specified for THEME according to SETTING-LIST. |