diff options
| author | Chong Yidong | 2005-11-25 18:00:10 +0000 |
|---|---|---|
| committer | Chong Yidong | 2005-11-25 18:00:10 +0000 |
| commit | e335f09e0ed1735d4a0f03079db5ba2f6ac5bf59 (patch) | |
| tree | e0edfd30f148fda7dd038da29f2377ffc1ecbd64 | |
| parent | 93a068651db6a8cff364cc38d6813861ed68547b (diff) | |
| download | emacs-e335f09e0ed1735d4a0f03079db5ba2f6ac5bf59.tar.gz emacs-e335f09e0ed1735d4a0f03079db5ba2f6ac5bf59.zip | |
* custom.el (enable-theme): Signal error if argument is not a
theme. Don't recalculate a face if it's not loaded yet.
* cus-face.el (custom-theme-set-faces): Don't change saved-face if
the `user' theme is in effect.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/cus-face.el | 11 | ||||
| -rw-r--r-- | lisp/custom.el | 10 |
3 files changed, 22 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0d2a8503fbd..1f53f5ec12c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2005-11-25 Chong Yidong <cyd@stupidchicken.com> | 1 | 2005-11-25 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * custom.el (enable-theme): Signal error if argument is not a | ||
| 4 | theme. Don't recalculate a face if it's not loaded yet. | ||
| 5 | |||
| 6 | * cus-face.el (custom-theme-set-faces): Don't change saved-face if | ||
| 7 | the `user' theme is in effect. | ||
| 8 | |||
| 3 | * info.el (Info-on-current-buffer): Record actual filename in | 9 | * info.el (Info-on-current-buffer): Record actual filename in |
| 4 | Info-current-file, instead of t, or a fake filename if a non-file | 10 | Info-current-file, instead of t, or a fake filename if a non-file |
| 5 | buffer. Make autoload. | 11 | buffer. Make autoload. |
diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 8a6e77f9805..66713c28661 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el | |||
| @@ -320,13 +320,18 @@ FACE's list property `theme-face' \(using `custom-push-theme')." | |||
| 320 | (let ((face (nth 0 entry)) | 320 | (let ((face (nth 0 entry)) |
| 321 | (spec (nth 1 entry)) | 321 | (spec (nth 1 entry)) |
| 322 | (now (nth 2 entry)) | 322 | (now (nth 2 entry)) |
| 323 | (comment (nth 3 entry))) | 323 | (comment (nth 3 entry)) |
| 324 | oldspec) | ||
| 324 | ;; If FACE is actually an alias, customize the face it | 325 | ;; If FACE is actually an alias, customize the face it |
| 325 | ;; is aliased to. | 326 | ;; is aliased to. |
| 326 | (if (get face 'face-alias) | 327 | (if (get face 'face-alias) |
| 327 | (setq face (get face 'face-alias))) | 328 | (setq face (get face 'face-alias))) |
| 328 | (put face 'saved-face spec) | 329 | |
| 329 | (put face 'saved-face-comment comment) | 330 | (setq oldspec (get face 'theme-face)) |
| 331 | (when (not (and oldspec (eq 'user (caar oldspec)))) | ||
| 332 | (put face 'saved-face spec) | ||
| 333 | (put face 'saved-face-comment comment)) | ||
| 334 | |||
| 330 | (custom-push-theme 'theme-face face theme 'set spec) | 335 | (custom-push-theme 'theme-face face theme 'set spec) |
| 331 | (when (or now immediate) | 336 | (when (or now immediate) |
| 332 | (put face 'force-face (if now 'rogue 'immediate))) | 337 | (put face 'force-face (if now 'rogue 'immediate))) |
diff --git a/lisp/custom.el b/lisp/custom.el index 0c6085c714f..b2a9ba6443c 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -1120,9 +1120,14 @@ See `custom-theme-load-themes' for more information on BODY." | |||
| 1120 | (defun enable-theme (theme) | 1120 | (defun enable-theme (theme) |
| 1121 | "Reenable all variable and face settings defined by THEME. | 1121 | "Reenable all variable and face settings defined by THEME. |
| 1122 | The newly enabled theme gets the highest precedence (after `user'). | 1122 | The newly enabled theme gets the highest precedence (after `user'). |
| 1123 | If it is already enabled, just give it highest precedence (after `user')." | 1123 | If it is already enabled, just give it highest precedence (after `user'). |
| 1124 | |||
| 1125 | This signals an error if THEME does not specify any theme | ||
| 1126 | settings. Theme settings are set using `load-theme'." | ||
| 1124 | (interactive "SEnable Custom theme: ") | 1127 | (interactive "SEnable Custom theme: ") |
| 1125 | (let ((settings (get theme 'theme-settings))) | 1128 | (let ((settings (get theme 'theme-settings))) |
| 1129 | (if (and (not (eq theme 'user)) (null settings)) | ||
| 1130 | (error "No theme settings defined in %s." (symbol-name theme))) | ||
| 1126 | (dolist (s settings) | 1131 | (dolist (s settings) |
| 1127 | (let* ((prop (car s)) | 1132 | (let* ((prop (car s)) |
| 1128 | (symbol (cadr s)) | 1133 | (symbol (cadr s)) |
| @@ -1130,7 +1135,8 @@ If it is already enabled, just give it highest precedence (after `user')." | |||
| 1130 | (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) | 1135 | (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) |
| 1131 | (if (eq prop 'theme-value) | 1136 | (if (eq prop 'theme-value) |
| 1132 | (custom-theme-recalc-variable symbol) | 1137 | (custom-theme-recalc-variable symbol) |
| 1133 | (custom-theme-recalc-face symbol))))) | 1138 | (if (facep symbol) |
| 1139 | (custom-theme-recalc-face symbol)))))) | ||
| 1134 | (setq custom-enabled-themes | 1140 | (setq custom-enabled-themes |
| 1135 | (cons theme (delq theme custom-enabled-themes))) | 1141 | (cons theme (delq theme custom-enabled-themes))) |
| 1136 | ;; `user' must always be the highest-precedence enabled theme. | 1142 | ;; `user' must always be the highest-precedence enabled theme. |