diff options
| author | Chong Yidong | 2011-06-18 14:49:19 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-06-18 14:49:19 -0400 |
| commit | 61dfb316ecfae23ea093a48ab67b9c66e9d1d7da (patch) | |
| tree | 41b3a11bd9810172c82536a0f4949b1e1c9af9d2 | |
| parent | 6d10d800bd766822d7563b0cbb16b51ccd7f79ed (diff) | |
| download | emacs-61dfb316ecfae23ea093a48ab67b9c66e9d1d7da.tar.gz emacs-61dfb316ecfae23ea093a48ab67b9c66e9d1d7da.zip | |
Fix for disable-theme/defface interaction (Bug#8889).
* lisp/cus-face.el (custom-declare-face): Call custom-theme-recalc face
anytime existing face settings are present.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/cus-face.el | 51 |
2 files changed, 30 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 755afbfeff6..012397968d9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-06-18 Chong Yidong <cyd@stupidchicken.com> | 1 | 2011-06-18 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * cus-face.el (custom-declare-face): Call custom-theme-recalc face | ||
| 4 | anytime existing face settings are present (Bug#8889). | ||
| 5 | |||
| 3 | * progmodes/delphi.el (delphi-mode-syntax-table): Use defvar. | 6 | * progmodes/delphi.el (delphi-mode-syntax-table): Use defvar. |
| 4 | (delphi-mode): Use define-derived-mode to inherit from prog-mode. | 7 | (delphi-mode): Use define-derived-mode to inherit from prog-mode. |
| 5 | Remove unused argument. | 8 | Remove unused argument. |
diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 90f21f32149..c23632ab885 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el | |||
| @@ -34,30 +34,33 @@ | |||
| 34 | (defun custom-declare-face (face spec doc &rest args) | 34 | (defun custom-declare-face (face spec doc &rest args) |
| 35 | "Like `defface', but FACE is evaluated as a normal argument." | 35 | "Like `defface', but FACE is evaluated as a normal argument." |
| 36 | (unless (get face 'face-defface-spec) | 36 | (unless (get face 'face-defface-spec) |
| 37 | (unless (facep face) | 37 | (let ((facep (facep face))) |
| 38 | ;; If the user has already created the face, respect that. | 38 | (unless facep |
| 39 | (let ((value (or (get face 'saved-face) spec)) | 39 | ;; If the user has already created the face, respect that. |
| 40 | (have-window-system (memq initial-window-system '(x w32)))) | 40 | (let ((value (or (get face 'saved-face) spec)) |
| 41 | ;; Create global face. | 41 | (have-window-system (memq initial-window-system '(x w32)))) |
| 42 | (make-empty-face face) | 42 | ;; Create global face. |
| 43 | ;; Create frame-local faces | 43 | (make-empty-face face) |
| 44 | (dolist (frame (frame-list)) | 44 | ;; Create frame-local faces |
| 45 | (face-spec-set-2 face frame value) | 45 | (dolist (frame (frame-list)) |
| 46 | (when (memq (window-system frame) '(x w32 ns)) | 46 | (face-spec-set-2 face frame value) |
| 47 | (setq have-window-system t))) | 47 | (when (memq (window-system frame) '(x w32 ns)) |
| 48 | ;; When making a face after frames already exist | 48 | (setq have-window-system t))) |
| 49 | (if have-window-system | 49 | ;; When making a face after frames already exist |
| 50 | (make-face-x-resource-internal face)))) | 50 | (if have-window-system |
| 51 | ;; Don't record SPEC until we see it causes no errors. | 51 | (make-face-x-resource-internal face)))) |
| 52 | (put face 'face-defface-spec (purecopy spec)) | 52 | ;; Don't record SPEC until we see it causes no errors. |
| 53 | (push (cons 'defface face) current-load-list) | 53 | (put face 'face-defface-spec (purecopy spec)) |
| 54 | (when (and doc (null (face-documentation face))) | 54 | (push (cons 'defface face) current-load-list) |
| 55 | (set-face-documentation face (purecopy doc))) | 55 | (when (and doc (null (face-documentation face))) |
| 56 | (custom-handle-all-keywords face args 'custom-face) | 56 | (set-face-documentation face (purecopy doc))) |
| 57 | (run-hooks 'custom-define-hook) | 57 | (custom-handle-all-keywords face args 'custom-face) |
| 58 | ;; If the face has an existing theme setting, recalculate it. | 58 | (run-hooks 'custom-define-hook) |
| 59 | (if (get face 'theme-face) | 59 | ;; If the face had existing settings, recalculate it. For |
| 60 | (custom-theme-recalc-face face))) | 60 | ;; example, the user might load a theme with a face setting, and |
| 61 | ;; later load a library defining that face. | ||
| 62 | (if facep | ||
| 63 | (custom-theme-recalc-face face)))) | ||
| 61 | face) | 64 | face) |
| 62 | 65 | ||
| 63 | ;;; Face attributes. | 66 | ;;; Face attributes. |