[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6a2a7df 018/271: Use idle timers instead of font lock.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 6a2a7df 018/271: Use idle timers instead of font lock. |
Date: |
Thu, 05 Feb 2015 18:29:27 +0000 |
branch: master
commit 6a2a7df3a7c2986ef4deeabea3ab1020bff9d231
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Use idle timers instead of font lock.
---
context-coloring.el | 10 ++++------
test/fixtures/monad.js | 24 ++++++++++++++++--------
2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 6e5a2ba..1785ccb 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -89,7 +89,7 @@ For example: 'context-coloring-depth-1-face'."
(let ((start (cdr (assoc 's token)))
(end (cdr (assoc 'e token)))
(face (context-coloring-level-face (cdr (assoc 'l token)))))
- (add-text-properties start end `(font-lock-face ,face rear-nonsticky
t))))))
+ (add-text-properties start end `(face ,face rear-nonsticky t))))))
(defun context-coloring-tokenizer-filter (process chunk)
(setq context-coloring-tokenizer-output
@@ -119,9 +119,6 @@ For example: 'context-coloring-depth-1-face'."
(interactive)
(context-coloring-tokenize))
-(defun context-coloring-fontify-region (start end)
- (context-coloring-tokenize))
-
;;; Minor mode
@@ -131,9 +128,10 @@ For example: 'context-coloring-depth-1-face'."
nil " Context" nil
(if (not context-coloring-mode)
(progn
- (jit-lock-unregister 'context-coloring-fontify-region))
+ (cancel-timer context-coloring-colorize-buffer-timer))
(set (make-local-variable 'context-coloring-tokenizer-output) nil)
- (jit-lock-register 'context-coloring-fontify-region)))
+ (set (make-local-variable 'context-coloring-colorize-buffer-timer)
+ (run-with-idle-timer 0.25 t 'context-coloring-colorize-buffer))))
;;;###autoload
(defun context-coloring-mode-enable ()
diff --git a/test/fixtures/monad.js b/test/fixtures/monad.js
index 4a2e19c..ed47fa0 100644
--- a/test/fixtures/monad.js
+++ b/test/fixtures/monad.js
@@ -1,9 +1,17 @@
-function MONAD() {
- return function unit(value) {
- var monad = Object.create(null);
- monad.bind = function (func) {
- return func(value);
+(function () {
+
+ 'use strict';
+
+ function MONAD() {
+ return function unit(value) {
+ var monad = Object.create(null);
+ monad.bind = function (func) {
+ return func(value);
+ };
+ return monad;
};
- return monad;
- };
-}
+ }
+
+ return MONAD;
+
+}());
- [elpa] master 6d79b91 024/271: Idly colorizing after changes working. Cancelling seemingly not working., (continued)
- [elpa] master 6d79b91 024/271: Idly colorizing after changes working. Cancelling seemingly not working., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fd4b629 007/271: Add mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6e991c4 014/271: Fix off-by-one error., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b35380b 019/271: Vastly improve idle timer strategy., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7ac8db6 012/271: Fix a bug where strings were matched., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 806398e 016/271: Use asynchronous command execution strategy., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d0f5470 022/271: Successfully lexically bind buffer., Jackson Ray Hamilton, 2015/02/05
- [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 <=
- [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, 2015/02/05
- [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