From 79e9c1cf9a20e8395fc634207cda720073e00271 Mon Sep 17 00:00:00 2001 From: Ustun Ozgur Date: Tue, 9 May 2017 11:21:35 +0300 Subject: [PATCH] Update various faces when a theme is disabled Previously, we were only updating faces when we enable themes. --- CHANGELOG.md | 1 + cider-doc.el | 5 +++++ cider-stacktrace.el | 5 +++++ cider-test.el | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30169e444..587ccfa79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ ### Bugs Fixed +* [#1987](https://github.com/clojure-emacs/cider/issues/1987): Fix: Update faces when disabling a theme * [#1962](https://github.com/clojure-emacs/cider/issues/1962): Fix performance in fringe overlay placement. * [#1947](https://github.com/clojure-emacs/cider/issues/1947): Fix error on `cider-jack-in` when `enlighten-mode` is enabled. * [#1588](https://github.com/clojure-emacs/cider/issues/1588): Redirect `*err*`, `java.lang.System/out`, and `java.lang.System/err` to REPL buffer on all attached sessions. diff --git a/cider-doc.el b/cider-doc.el index c367edfa9..bf22bf974 100644 --- a/cider-doc.el +++ b/cider-doc.el @@ -135,6 +135,11 @@ "When theme is changed, update `cider-docview-code-background-color'." (setq cider-docview-code-background-color (cider-scale-background-color))) + +(defadvice disable-theme (after cider-docview-adapt-to-theme activate) + "When theme is disabled, update `cider-docview-code-background-color'." + (setq cider-docview-code-background-color (cider-scale-background-color))) + ;; Mode & key bindings diff --git a/cider-stacktrace.el b/cider-stacktrace.el index 4bd105352..f6cb1b96a 100644 --- a/cider-stacktrace.el +++ b/cider-stacktrace.el @@ -175,6 +175,11 @@ The error types are represented as strings." (setq cider-stacktrace-frames-background-color (cider-scale-background-color))) +(defadvice disable-theme (after cider-stacktrace-adapt-to-theme activate) + "When theme is disabled, update `cider-stacktrace-frames-background-color'." + (setq cider-stacktrace-frames-background-color (cider-scale-background-color))) + + ;; Mode & key bindings (defvar cider-stacktrace-mode-map diff --git a/cider-test.el b/cider-test.el index 6617ac2e9..a23a9bf88 100644 --- a/cider-test.el +++ b/cider-test.el @@ -122,6 +122,11 @@ Add to this list to have CIDER recognize additional test defining macros." (setq cider-test-items-background-color (cider-scale-background-color))) +(defadvice disable-theme (after cider-test-adapt-to-theme activate) + "When theme is disabled, update `cider-test-items-background-color'." + (setq cider-test-items-background-color (cider-scale-background-color))) + + ;;; Report mode & key bindings ;; The primary mode of interacting with test results is the report buffer, which ;; allows navigation among tests, jumping to test definitions, expected/actual