[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
- [elpa] master fedf885 269/271: Add note to readme about --version., (continued)
- [elpa] master fedf885 269/271: Add note to readme about --version., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d1715b2 177/271: Remove .gitignore entry., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6e5e95a 211/271: Pass key-value pair test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bbebea1 253/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7059157 187/271: Add note on byte compilation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 8300976 244/271: Merge branch 'master' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9a883e2 217/271: Version 2.1.0., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 34fb7e9 267/271: Fix readme link., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9fdc037 243/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7001dce 201/271: Use js2-node-top-level-decl-p as a fast track., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 221b583 156/271: Update hooking strategy.,
Jackson Ray Hamilton <=
- [elpa] master e2ee311 183/271: Fix timer existence check., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a2ba1ef 213/271: Version 2.0.1., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bef41e1 205/271: Merge branch 'feature/optimize-js2-mode' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master a14be3c 270/271: Merge commit 'fedf88552990afa269366dfa4c3f5af6d1cdb7c2' from context-coloring, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 32fa415 226/271: Use `font-lock' for comments and strings., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 450aa85 236/271: Use macros to clean up tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 555820b 247/271: Merge branch 'master' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 43bb3c1 261/271: Remove unnecessary file from .elpaignore., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 195fbe7 196/271: Improve assertion message., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d82f357 199/271: Merge branch 'feature/name-nodes' into develop, Jackson Ray Hamilton, 2015/02/05