[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4bd7fc7 56/79: Make delays configurable at the dispatch le
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 4bd7fc7 56/79: Make delays configurable at the dispatch level. |
Date: |
Sun, 14 Jun 2015 00:05:40 +0000 |
branch: master
commit 4bd7fc798b0c89df25aad921e898348d3b60d6b1
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Make delays configurable at the dispatch level.
---
README.md | 4 ++--
context-coloring.el | 37 ++++++++++++++++++++++++-------------
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index 4643cad..a180a17 100644
--- a/README.md
+++ b/README.md
@@ -85,8 +85,8 @@ Add the following to your init file:
comments using `font-lock`.
- `context-coloring-syntactic-strings` (default: `t`): If non-nil, also color
strings using `font-lock`.
-- `context-coloring-delay` (default: `0.25`; supported modes: `js-mode`,
- `js3-mode`, `emacs-lisp-mode`): Delay between a buffer update and
+- `context-coloring-default-delay` (default: `0.25`; supported modes:
`js-mode`,
+ `js3-mode`): Default (sometimes overridden) delay between a buffer update and
colorization.
- `context-coloring-js-block-scopes` (default: `nil`; supported modes:
`js2-mode`): If non-nil, also color block scopes in the scope hierarchy in
diff --git a/context-coloring.el b/context-coloring.el
index ec7ab7a..a343292 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -159,27 +159,34 @@ used.")
(defvar-local context-coloring-colorize-idle-timer nil
"The currently-running idle timer.")
-(defcustom context-coloring-delay 0.25
- "Delay between a buffer update and colorization.
+(defcustom context-coloring-default-delay 0.25
+ "Default (sometimes overridden) delay between a buffer update
+and colorization.
Increase this if your machine is high-performing. Decrease it if
it ain't.
-Supported modes: `js-mode', `js3-mode', `emacs-lisp-mode'"
+Supported modes: `js-mode', `js3-mode'"
:group 'context-coloring)
+(make-obsolete-variable
+ 'context-coloring-delay
+ 'context-coloring-default-delay
+ "6.4.0")
+
(defun context-coloring-setup-idle-change-detection ()
"Setup idle change detection."
- (add-hook
- 'after-change-functions 'context-coloring-change-function nil t)
- (add-hook
- 'kill-buffer-hook 'context-coloring-teardown-idle-change-detection nil t)
- (setq context-coloring-colorize-idle-timer
- (run-with-idle-timer
- context-coloring-delay
- t
- 'context-coloring-maybe-colorize
- (current-buffer))))
+ (let ((dispatch (context-coloring-get-dispatch-for-mode major-mode)))
+ (add-hook
+ 'after-change-functions 'context-coloring-change-function nil t)
+ (add-hook
+ 'kill-buffer-hook 'context-coloring-teardown-idle-change-detection nil t)
+ (setq context-coloring-colorize-idle-timer
+ (run-with-idle-timer
+ (or (plist-get dispatch :delay) context-coloring-default-delay)
+ t
+ 'context-coloring-maybe-colorize
+ (current-buffer)))))
(defun context-coloring-teardown-idle-change-detection ()
"Teardown idle change detection."
@@ -1128,6 +1135,9 @@ level data returned via stdout.
`:port' - Port number of the scopifier server, e.g. 80, 1337.
+`:delay' - Delay between buffer update and colorization, to
+override `context-coloring-default-delay'.
+
`:version' - Minimum required version that should be printed when
executing `:command' with a \"--version\" flag. The version
should be numeric, e.g. \"2\", \"19700101\", \"1.2.3\",
@@ -1588,6 +1598,7 @@ precedence, i.e. the car of `custom-enabled-themes'."
'emacs-lisp
:modes '(emacs-lisp-mode)
:colorizer 'context-coloring-elisp-colorize
+ :delay 0.016 ;; Thanks to lazy colorization this can be 60 frames per second.
:setup 'context-coloring-setup-idle-change-detection
:teardown 'context-coloring-teardown-idle-change-detection)
- [elpa] master 0079778 48/79: Set `:send-report' to nil., (continued)
- [elpa] master 0079778 48/79: Set `:send-report' to nil., Jackson Ray Hamilton, 2015/06/13
- [elpa] master cacf5de 49/79: Add cond support., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 8d15938 43/79: Cleaner server implementation., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 89286b6 54/79: Cleanup., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 5f9bd49 50/79: Add comments and strings to the cond test., Jackson Ray Hamilton, 2015/06/13
- [elpa] master c2834f0 51/79: Add condition-case support., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 2ee41c1 52/79: Add comments and strings to condition-case test., Jackson Ray Hamilton, 2015/06/13
- [elpa] master e387aaf 45/79: Merge branch 'server' into elisp, Jackson Ray Hamilton, 2015/06/13
- [elpa] master 77b075f 60/79: Space., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 5857bc8 53/79: Refactor comments and strings coloring., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 4bd7fc7 56/79: Make delays configurable at the dispatch level.,
Jackson Ray Hamilton <=
- [elpa] master f870598 59/79: Fix infinite loop when parsing let., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 3c7a00d 55/79: Add lazy coloring., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 08e2981 63/79: Swallow scan errors., Jackson Ray Hamilton, 2015/06/13
- [elpa] master ec9f04d 64/79: Update emacs lisp support in readme., Jackson Ray Hamilton, 2015/06/13
- [elpa] master d2e08e8 62/79: Improve and test lazy coloring., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 46a9193 65/79: Find the edges of the screen more efficiently., Jackson Ray Hamilton, 2015/06/13
- [elpa] master fd4bc95 66/79: Add dolist support., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 9edc6c3 69/79: Checkdoc cleanup., Jackson Ray Hamilton, 2015/06/13
- [elpa] master e2ceef9 57/79: Prepend function symbols with octothorpes., Jackson Ray Hamilton, 2015/06/13
- [elpa] master 22403b7 61/79: Cover parsing edge cases., Jackson Ray Hamilton, 2015/06/13