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

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

[elpa] master 221b583 156/271: Update hooking strategy.


From: Jackson Ray Hamilton
Subject: [elpa] master 221b583 156/271: Update hooking strategy.
Date: Thu, 05 Feb 2015 18:30:44 +0000

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

    Update hooking strategy.
---
 context-coloring.el |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 5d58ff2..61d3807 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -438,7 +438,11 @@ colorizing would be redundant."
         (context-coloring-kill-scopifier)
         (when (not (null 'context-coloring-colorize-idle-timer))
           (cancel-timer context-coloring-colorize-idle-timer))
-        (remove-hook 'after-change-functions 'context-coloring-change-function 
t)
+        (cond
+         ((equal major-mode 'js2-mode)
+          (remove-hook 'js2-post-parse-callbacks 
'context-coloring-change-function t))
+         (t
+          (remove-hook 'after-change-functions 
'context-coloring-change-function t)))
         (font-lock-mode)
         (jit-lock-mode t))
 
@@ -451,11 +455,15 @@ colorizing would be redundant."
 
     ;; Colorize once initially.
     ;; (let ((start-time (float-time)))
-      (context-coloring-colorize)
+    (context-coloring-colorize)
     ;;  (message "Elapsed time: %f" (- (float-time) start-time)))
 
     ;; Only recolor on change.
-    (add-hook 'after-change-functions 'context-coloring-change-function nil t)
+    (cond
+     ((equal major-mode 'js2-mode)
+      (add-hook 'js2-post-parse-callbacks 'context-coloring-change-function 
nil t))
+     (t
+      (add-hook 'after-change-functions 'context-coloring-change-function nil 
t)))
 
     ;; Only recolor idly.
     (setq context-coloring-colorize-idle-timer



reply via email to

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