[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 07c5852 30/47: Add idle change teardown function.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 07c5852 30/47: Add idle change teardown function. |
Date: |
Mon, 18 May 2015 09:51:58 +0000 |
branch: master
commit 07c5852f857cba4c59a491a8d4d0f920a3d8f05a
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Add idle change teardown function.
---
context-coloring.el | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index d491f88..ae6abea 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -1340,6 +1340,14 @@ Supported modes: `js-mode', `js3-mode'"
t
'context-coloring-maybe-colorize)))
+(defun context-coloring-teardown-idle-change-detection ()
+ "Teardown idle change detection."
+ (context-coloring-kill-scopifier)
+ (when context-coloring-colorize-idle-timer
+ (cancel-timer context-coloring-colorize-idle-timer))
+ (remove-hook
+ 'after-change-functions 'context-coloring-change-function t))
+
;;; Built-in dispatches
@@ -1365,15 +1373,8 @@ Supported modes: `js-mode', `js3-mode'"
'emacs-lisp
:modes '(emacs-lisp-mode)
:colorizer 'context-coloring-emacs-lisp-colorize
- :setup
- (lambda ()
- (context-coloring-setup-idle-change-detection))
- :teardown
- (lambda ()
- (when context-coloring-colorize-idle-timer
- (cancel-timer context-coloring-colorize-idle-timer))
- (remove-hook
- 'after-change-functions 'context-coloring-change-function t)))
+ :setup 'context-coloring-setup-idle-change-detection
+ :teardown 'context-coloring-teardown-idle-change-detection)
(defun context-coloring-dispatch (&optional callback)
"Determine the optimal track for scopification / coloring of
@@ -1412,16 +1413,12 @@ elisp tracks, and asynchronously for shell command
tracks."
nil " Context" nil
(if (not context-coloring-mode)
(progn
- (context-coloring-kill-scopifier)
- (when context-coloring-colorize-idle-timer
- (cancel-timer context-coloring-colorize-idle-timer))
(let ((dispatch (gethash major-mode context-coloring-mode-hash-table)))
(when dispatch
(let ((command (plist-get dispatch :command))
(teardown (plist-get dispatch :teardown)))
(when command
- (remove-hook
- 'after-change-functions 'context-coloring-change-function t))
+ (context-coloring-teardown-idle-change-detection))
(when teardown
(funcall teardown)))))
(font-lock-mode)
- [elpa] master bd9c147 20/47: Ignore the dot., (continued)
- [elpa] master bd9c147 20/47: Ignore the dot., Jackson Ray Hamilton, 2015/05/18
- [elpa] master d7b2c92 21/47: Remove unused functions., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 0836b9f 22/47: Add change hooks for elisp., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 08bf3e4 23/47: Ignore question marks., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 09ec36e 24/47: Add interruption mechanism., Jackson Ray Hamilton, 2015/05/18
- [elpa] master dc2f9a6 25/47: Refactor maybe-colorize-comments-and-strings., Jackson Ray Hamilton, 2015/05/18
- [elpa] master a556195 26/47: Tweak iteration values, add logging., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 3fc5b20 27/47: Make dispatches fully redefinable., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 89f20e4 28/47: Improve interruptability of syntactic coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master d24de46 31/47: Add TODO., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 07c5852 30/47: Add idle change teardown function.,
Jackson Ray Hamilton <=
- [elpa] master ef544ef 29/47: Fontify keywords., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 5c5b429 32/47: Fix font-lock error., Jackson Ray Hamilton, 2015/05/18
- [elpa] master c0a6689 33/47: Only set defaults when the mode is enabled., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 59a6c8e 34/47: Fix timer disposal and timer buffer detection., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 88a921f 35/47: Improve defun regexp., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 438cb33 36/47: Fix incorrect last fontified position., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 1d7761c 37/47: Add constant comment test., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 4ff6e82 39/47: Remove verbose parsing., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 4bbce56 38/47: Add test for interruption., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 6392d1f 40/47: Bind optional parameters earlier., Jackson Ray Hamilton, 2015/05/18