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

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

[elpa] master fc81cf9 157/271: Don't use timers for js2-mode.


From: Jackson Ray Hamilton
Subject: [elpa] master fc81cf9 157/271: Don't use timers for js2-mode.
Date: Thu, 05 Feb 2015 18:30:45 +0000

branch: master
commit fc81cf9d788349fcafffb8fa91ea7b84839e0860
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Don't use timers for js2-mode.
---
 context-coloring.el |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 61d3807..986d90d 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -458,16 +458,18 @@ colorizing would be redundant."
     (context-coloring-colorize)
     ;;  (message "Elapsed time: %f" (- (float-time) start-time)))
 
-    ;; Only recolor on change.
     (cond
      ((equal major-mode 'js2-mode)
-      (add-hook 'js2-post-parse-callbacks 'context-coloring-change-function 
nil t))
+      ;; Only recolor on reparse.
+      (add-hook 'js2-post-parse-callbacks 'context-coloring-colorize nil t))
      (t
+      ;; Only recolor on change.
       (add-hook 'after-change-functions 'context-coloring-change-function nil 
t)))
 
-    ;; Only recolor idly.
-    (setq context-coloring-colorize-idle-timer
-          (run-with-idle-timer context-coloring-delay t 
'context-coloring-maybe-colorize))))
+    (when (not (equal major-mode 'js2-mode))
+      ;; Only recolor idly.
+      (setq context-coloring-colorize-idle-timer
+            (run-with-idle-timer context-coloring-delay t 
'context-coloring-maybe-colorize)))))
 
 (provide 'context-coloring)
 



reply via email to

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