[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e448e2f 025/271: Cancelling working.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master e448e2f 025/271: Cancelling working. |
Date: |
Thu, 05 Feb 2015 18:29:30 +0000 |
branch: master
commit e448e2f01287f9b92efde533c6352c43fa91ffb2
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Cancelling working.
---
context-coloring.el | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 2a0acb7..33defb5 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -100,15 +100,19 @@ For example: \"context-coloring-depth-1-face\"."
(face (context-coloring-level-face (cdr (assoc 'l token)))))
(add-text-properties start end `(font-lock-face ,face rear-nonsticky
t))))))
+(defun context-coloring-kill-tokenizer ()
+ (when (not (null context-coloring-tokenizer-process))
+ (delete-process context-coloring-tokenizer-process)
+ (setq context-coloring-tokenizer-process nil)))
+
(defun context-coloring-tokenize ()
"Invokes the external tokenizer with the current buffer's
contents, reading the tokenizer's response asynchronously and
calling FUNCTION with the parsed list of tokens."
- ;; Cancel a running process because it is implicitly obsolete if we are
- ;; calling this function.
- (when (not (null context-coloring-tokenizer-process))
- (delete-process context-coloring-tokenizer-process))
+ ;; Prior running tokenization is implicitly obsolete if this function is
+ ;; called.
+ (context-coloring-kill-tokenizer)
;; Start the process.
(setq context-coloring-tokenizer-process
@@ -133,6 +137,7 @@ calling FUNCTION with the parsed list of tokens."
(json-read-from-string output))))
(with-current-buffer buffer
(context-coloring-apply-tokens tokens))
+ (setq context-coloring-tokenizer-process nil)
(message "Colorized (after %f seconds)."
(- (float-time) start-time)))))))
@@ -150,6 +155,8 @@ calling FUNCTION with the parsed list of tokens."
(context-coloring-tokenize))
(defun context-coloring-change-function (start end length)
+ ;; Tokenization is obsolete if there was a change.
+ (context-coloring-kill-tokenizer)
(setq context-coloring-changed t))
(defun context-coloring-maybe-colorize ()
- [elpa] master 397ef04 005/271: Detect globals., (continued)
- [elpa] master 397ef04 005/271: Detect globals., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 409a05b 017/271: Enable font lock again., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a72314c 008/271: Write temp files., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6a2a7df 018/271: Use idle timers instead of font lock., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 0a4248b 009/271: Update chunk size., Jackson Ray Hamilton, 2015/02/05
- [elpa] master ffd69f5 026/271: Minutia., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f349ecb 027/271: Minutia., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 35453e0 015/271: Only color changed regions., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 222276b 001/271: Init., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 09166f9 021/271: Some progress, probably have to switch back to lexical., Jackson Ray Hamilton, 2015/02/05
- [elpa] master e448e2f 025/271: Cancelling working.,
Jackson Ray Hamilton <=
- [elpa] master 97194c7 023/271: Apply tokens with lexically-bound buffer as current., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b4b86ac 033/271: Fix after-change-functions with add-hook. Fix nulls., Jackson Ray Hamilton, 2015/02/05
- [elpa] master cce215d 030/271: Add readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 169b1f4 028/271: Set JSLint options to not care., Jackson Ray Hamilton, 2015/02/05
- [elpa] master df36161 031/271: Fix screenshot link., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 16e984c 039/271: Update installation instructions., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3e6f2cf 037/271: Cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bd8fc87 034/271: Restore test files. Start on uglify tokenizer., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 099e8c1 003/271: Write basic tokenizer cli., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fef44f5 038/271: Fix broken link., Jackson Ray Hamilton, 2015/02/05