emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master ce5c6d9 07/31: Write and pass post-recede test.


From: Jackson Ray Hamilton
Subject: [elpa] master ce5c6d9 07/31: Write and pass post-recede test.
Date: Mon, 09 Feb 2015 01:09:31 +0000

branch: master
commit ce5c6d9ce510627dd5d879eeb738321192fc9e6a
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Write and pass post-recede test.
---
 context-coloring.el           |    9 ++++++---
 test/context-coloring-test.el |   19 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 06bd92c..0f2f9fa3 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -572,14 +572,16 @@ raised, at which point you may want to enable the 
`:override'
 option, or just delete your theme and opt to use your custom
 theme's author's colors instead."
   (let ((aliases (plist-get properties :aliases))
-        (override (plist-get properties :override)))
+        (override (plist-get properties :override))
+        (recede (plist-get properties :recede)))
     (dolist (name (append `(,theme) aliases))
       (when (and (not override)
                  (context-coloring-theme-definedp name))
         (context-coloring-warn-theme-defined name))
       (puthash name properties context-coloring-theme-hash-table)
       ;; Set (or overwrite) colors.
-      (when (custom-theme-p name)
+      (when (and (custom-theme-p name)
+                 (not recede))
         (context-coloring-apply-theme name)))))
 
 (defun context-coloring-load-theme (&optional rest)
@@ -605,7 +607,8 @@ THEME."
           (context-coloring-apply-theme theme)))))
      (t
       (let ((defined (context-coloring-theme-definedp theme)))
-        (when (and defined (not override))
+        (when (and defined
+                   (not override))
           (context-coloring-warn-theme-defined theme))
         (context-coloring-apply-theme theme))))))
 
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index c6a29e6..c81be7c 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -430,7 +430,7 @@ t for a theme with SETTINGS."
   (context-coloring-test-assert-face 0 "#cccccc")
   (context-coloring-test-assert-face 1 "#dddddd"))
 
-(context-coloring-test-deftest-define-theme preexisting-recede
+(context-coloring-test-deftest-define-theme pre-recede
   (context-coloring-define-theme
    theme
    :recede t
@@ -446,6 +446,23 @@ t for a theme with SETTINGS."
   (context-coloring-test-assert-face 0 "#cccccc")
   (context-coloring-test-assert-face 1 "#dddddd"))
 
+(context-coloring-test-deftest-define-theme post-recede
+  (context-coloring-test-deftheme theme)
+  (custom-theme-set-faces
+   theme
+   '(context-coloring-level-0-face ((t (:foreground "#aaaaaa"))))
+   '(context-coloring-level-1-face ((t (:foreground "#bbbbbb")))))
+  (context-coloring-define-theme
+   theme
+   :recede t
+   :colors '("#cccccc"
+             "#dddddd"))
+  (context-coloring-test-assert-no-message "*Warnings*")
+  (enable-theme theme)
+  (context-coloring-test-assert-no-message "*Warnings*")
+  (context-coloring-test-assert-face 0 "#aaaaaa")
+  (context-coloring-test-assert-face 1 "#bbbbbb"))
+
 (context-coloring-test-deftest-define-theme 
preexisting-unintentional-obstinance
   (context-coloring-define-theme
    theme



reply via email to

[Prev in Thread] Current Thread [Next in Thread]