[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2b687ae 19/31: Pass test for disabling.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 2b687ae 19/31: Pass test for disabling. |
Date: |
Mon, 09 Feb 2015 01:09:36 +0000 |
branch: master
commit 2b687aee163eb50f5baf924850584251839f2882
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Pass test for disabling.
---
context-coloring.el | 15 ++++++++++++---
test/context-coloring-test.el | 31 +++++++++++++++++++++++--------
2 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 054cdbc..bcbe86e 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -665,11 +665,20 @@ THEME."
(defadvice enable-theme (after context-coloring-enable-theme (theme) activate)
"Enable colors for context themes just-in-time. We can't set
faces for custom themes that might not exist yet."
- (when (and (not (eq theme 'user)) ; Called internally by `enable-theme'.
- (context-coloring-theme-p theme)
- (custom-theme-p theme)) ; Guard against non-existent themes.
+ (when (and (not (eq theme 'user)) ; Called internally by `enable-theme'.
+ (custom-theme-p theme) ; Guard against non-existent themes.
+ (context-coloring-theme-p theme))
(context-coloring-enable-theme theme)))
+(defadvice disable-theme (after context-coloring-disable-theme (theme)
activate)
+ "Colors are disabled normally, but
+`context-coloring-face-count' isn't. Update it here."
+ (when (custom-theme-p theme) ; Guard against non-existent themes.
+ (let ((enabled-theme (car custom-enabled-themes)))
+ (if (context-coloring-theme-p enabled-theme)
+ (context-coloring-enable-theme enabled-theme)
+ (context-coloring-set-colors-default)))))
+
(context-coloring-define-theme
'leuven
:recede t
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index dcad8e3..8c79b4c 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -568,21 +568,36 @@ return t for a theme with SETTINGS."
(apply 'context-coloring-test-assert-face-count
(append arguments '(t))))
-(context-coloring-test-deftest-define-theme disable
+(context-coloring-test-deftest-define-theme disable-cascade
(context-coloring-test-deftheme theme)
(context-coloring-define-theme
theme
:colors '("#aaaaaa"
"#bbbbbb"))
- (let ((other-theme (context-coloring-test-get-next-theme)))
- (context-coloring-test-deftheme other-theme)
+ (let ((second-theme (context-coloring-test-get-next-theme)))
+ (context-coloring-test-deftheme second-theme)
(context-coloring-define-theme
- other-theme
+ second-theme
:colors '("#cccccc"
- "#dddddd"))
- (enable-theme theme)
- (enable-theme other-theme)
- (disable-theme other-theme)
+ "#dddddd"
+ "#eeeeee"))
+ (let ((third-theme (context-coloring-test-get-next-theme)))
+ (context-coloring-test-deftheme third-theme)
+ (context-coloring-define-theme
+ third-theme
+ :colors '("#111111"
+ "#222222"
+ "#333333"
+ "#444444"))
+ (enable-theme theme)
+ (enable-theme second-theme)
+ (enable-theme third-theme)
+ (disable-theme third-theme)
+ (context-coloring-test-assert-face 0 "#cccccc")
+ (context-coloring-test-assert-face 1 "#dddddd")
+ (context-coloring-test-assert-face 2 "#eeeeee")
+ (context-coloring-test-assert-face-count 3))
+ (disable-theme second-theme)
(context-coloring-test-assert-face 0 "#aaaaaa")
(context-coloring-test-assert-face 1 "#bbbbbb")
(context-coloring-test-assert-face-count 2))
- [elpa] master 06a7606 10/31: Pass / update tests for warnings., (continued)
- [elpa] master 06a7606 10/31: Pass / update tests for warnings., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 6e6bc61 15/31: Rename themep to theme-p., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 0f036c9 13/31: Improve documentation for themes., Jackson Ray Hamilton, 2015/02/08
- [elpa] master ca7122c 16/31: Remove `when'., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 71a1a0c 14/31: Rename ambiguous "defined" to "originally set"., Jackson Ray Hamilton, 2015/02/08
- [elpa] master c4459fe 02/31: Fix faces on light tty backgrounds. Be more conservative about applying themes., Jackson Ray Hamilton, 2015/02/08
- [elpa] master cda491a 17/31: Long lines., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 807f484 03/31: Allow themes to be overridden, but warn., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 2090e5d 11/31: Add missing case for a theme that does not set faces., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 6eef78b 21/31: Add spacegray theme., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 2b687ae 19/31: Pass test for disabling.,
Jackson Ray Hamilton <=
- [elpa] master a197a8c 20/31: Add disclaimer about precedence., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 9d55bd6 18/31: Generalize assertions. Write failing test for disabling., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 3bd7e26 22/31: Add anti-zenburn theme., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 35b3e71 23/31: Add ample theme., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 0b42ae1 24/31: Add grandshell theme., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 0b8d03d 25/31: Update readme., Jackson Ray Hamilton, 2015/02/08
- [elpa] master fb14816 26/31: Update readme., Jackson Ray Hamilton, 2015/02/08
- [elpa] master c2b6999 29/31: Version 5.0.0., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 6f3ad75 30/31: Update test function documentation., Jackson Ray Hamilton, 2015/02/08
- [elpa] master 2889b27 27/31: Mark unused lexical argument., Jackson Ray Hamilton, 2015/02/08