From 5f51ad4c74cc595bcc10460f3901094932e156f5 Mon Sep 17 00:00:00 2001 From: Jackson Hamilton Date: Sun, 3 Apr 2016 14:13:33 -0700 Subject: [PATCH] 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 0a8e22c09..b8de781b7 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 6f155b6de..e064093d2 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 -- 2.39.2