[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8d54c2e 08/12: Suppress unavailable messages in minibuffer
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 8d54c2e 08/12: Suppress unavailable messages in minibuffer. |
Date: |
Sun, 21 Jun 2015 21:16:14 +0000 |
branch: master
commit 8d54c2e2b78eef8a785d20f557072ddfe6345770
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Suppress unavailable messages in minibuffer.
---
context-coloring.el | 20 ++++++++++++++++++--
test/context-coloring-test.el | 17 +++++++++++++++--
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 1967cdf..5b5eb28 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -1186,6 +1186,22 @@ override `context-coloring-default-delay'.
:setup #'context-coloring-setup-idle-change-detection
:teardown #'context-coloring-teardown-idle-change-detection)
+(defvar context-coloring-ignore-unavailable-predicates
+ (list
+ #'minibufferp)
+ "Cases when \"unavailable\" messages are silenced.
+Necessary in editing states where coloring is only sometimes
+permissible.")
+
+(defun context-coloring-ignore-unavailable-message-p ()
+ "Determine if the unavailable message should be silenced."
+ (let ((predicates context-coloring-ignore-unavailable-predicates)
+ (ignore-p nil))
+ (while (and predicates
+ (not ignore-p))
+ (setq ignore-p (funcall (pop predicates))))
+ ignore-p))
+
;;; Minor mode
@@ -1233,8 +1249,8 @@ Feature inspired by Douglas Crockford."
;; Colorize once initially.
(let ((context-coloring-parse-interruptable-p nil))
(context-coloring-colorize))))
- (t
- (message "Context coloring is not available for this major mode")))))
+ ((not (context-coloring-ignore-unavailable-message-p))
+ (message "Context coloring is unavailable here")))))
(t
(let ((dispatch (context-coloring-get-current-dispatch)))
(when dispatch
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index afacbec..f5633b8 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -259,7 +259,7 @@ signaled."
(lambda ()
(context-coloring-mode)
(context-coloring-test-assert-message
- "Context coloring is not available for this major mode"
+ "Context coloring is unavailable here"
"*Messages*")))
(context-coloring-test-deftest derived-mode
@@ -267,9 +267,22 @@ signaled."
(lisp-interaction-mode)
(context-coloring-mode)
(context-coloring-test-assert-not-message
- "Context coloring is not available for this major mode"
+ "Context coloring is unavailable here"
"*Messages*")))
+(context-coloring-test-deftest unavailable-message-ignored
+ (lambda ()
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (context-coloring-mode)
+ (context-coloring-test-assert-not-message
+ "Context coloring is unavailable here"
+ "*Messages*"))
+ (execute-kbd-macro
+ (vconcat
+ [?\C-u]
+ [?\M-!])))))
+
(context-coloring-test-define-derived-mode define-dispatch-error)
(context-coloring-test-deftest define-dispatch-error
- [elpa] master updated (afda2e6 -> 98073fe), Jackson Ray Hamilton, 2015/06/21
- [elpa] master f0bc797 04/12: Use old advice for Emacs 24.3., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 89f862a 03/12: Minutia., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 2487c3a 07/12: Fix eval-expression detection., Jackson Ray Hamilton, 2015/06/21
- [elpa] master b31aa52 05/12: Automatically determine the maximum face., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 8d54c2e 08/12: Suppress unavailable messages in minibuffer.,
Jackson Ray Hamilton <=
- [elpa] master 32b276e 11/12: Version 7.0.0., Jackson Ray Hamilton, 2015/06/21
- [elpa] master ef0c4da 09/12: Cleanup refactoring artifacts., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 354ac23 06/12: Checkdoc compliance., Jackson Ray Hamilton, 2015/06/21
- [elpa] master cbffe2a 02/12: Remove automatic theming., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 92d3d12 01/12: Remove asynchronous support., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 1bebaa4 10/12: Merge branch 'debt', Jackson Ray Hamilton, 2015/06/21
- [elpa] master 98073fe 12/12: Merge commit '32b276e96118f9e34f4cf9a5a2ae6cae3e772144' from context-coloring, Jackson Ray Hamilton, 2015/06/21