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

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

[elpa] master 5f51ad4 03/25: Don't use derived-mode-parent dispatches.


From: Jackson Ray Hamilton
Subject: [elpa] master 5f51ad4 03/25: Don't use derived-mode-parent dispatches.
Date: Mon, 30 May 2016 22:10:44 +0000 (UTC)

branch: master
commit 5f51ad4c74cc595bcc10460f3901094932e156f5
Author: Jackson Hamilton <address@hidden>
Commit: Jackson Hamilton <address@hidden>

    Don't use derived-mode-parent dispatches.
---
 context-coloring.el           |    9 +++------
 test/context-coloring-test.el |    8 --------
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 0a8e22c..b8de781 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -1217,16 +1217,13 @@ It could be a quoted or backquoted expression."
 (defun context-coloring-get-current-dispatch ()
   "Return the first dispatch appropriate for the current state."
   (let ((predicates context-coloring-dispatch-predicates)
-        (parent major-mode)
         dispatch)
     ;; Maybe a predicate will be satisfied and return a dispatch.
     (while (and predicates
                 (not (setq dispatch (funcall (pop predicates))))))
     ;; If not, maybe a major mode (or a derivative) will define a dispatch.
     (when (not dispatch)
-      (while (and parent
-                  (not (setq dispatch (gethash parent 
context-coloring-mode-hash-table)))
-                  (setq parent (get parent 'derived-mode-parent)))))
+      (setq dispatch (gethash major-mode context-coloring-mode-hash-table)))
     dispatch))
 
 (defun context-coloring-define-dispatch (symbol &rest properties)
@@ -1300,7 +1297,7 @@ override `context-coloring-default-delay'.
 
 (context-coloring-define-dispatch
  'javascript
- :modes '(js2-mode)
+ :modes '(js2-mode js2-jsx-mode)
  :colorizer #'context-coloring-js2-colorize
  :setup
  (lambda ()
@@ -1311,7 +1308,7 @@ override `context-coloring-default-delay'.
 
 (context-coloring-define-dispatch
  'emacs-lisp
- :modes '(emacs-lisp-mode)
+ :modes '(emacs-lisp-mode lisp-interaction-mode)
  :colorizer #'context-coloring-elisp-colorize
  :delay 0.016 ;; Thanks to lazy colorization this can be 60 frames per second.
  :setup #'context-coloring-setup-idle-change-detection
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index 6f155b6..e064093 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -267,14 +267,6 @@ signaled."
      "Context coloring is unavailable here"
      "*Messages*")))
 
-(context-coloring-test-deftest derived-mode
-  (lambda ()
-    (lisp-interaction-mode)
-    (context-coloring-mode)
-    (context-coloring-test-assert-not-message
-     "Context coloring is unavailable here"
-     "*Messages*")))
-
 (context-coloring-test-deftest unavailable-message-ignored
   (lambda ()
     (minibuffer-with-setup-hook



reply via email to

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