]> code.delx.au - gnu-emacs-elpa/commitdiff
Don't use derived-mode-parent dispatches.
authorJackson Hamilton <jackson@jacksonrayhamilton.com>
Sun, 3 Apr 2016 21:13:33 +0000 (14:13 -0700)
committerJackson Hamilton <jackson@jacksonrayhamilton.com>
Sun, 3 Apr 2016 21:13:33 +0000 (14:13 -0700)
context-coloring.el
test/context-coloring-test.el

index 0a8e22c09efbc806e968bc488cad2b8dded7cd7b..b8de781b70ae3cd5588768a4d9e8ffe4afa66e78 100644 (file)
@@ -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
index 6f155b6de87cb9fdb0cad15e71a62320393e08ff..e064093d2c0f08d57a25a872493e7ce7a54b1501 100644 (file)
@@ -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