[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4c5f3ab 145/271: Fix first-run bug, passing js2-mode test.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 4c5f3ab 145/271: Fix first-run bug, passing js2-mode test. |
Date: |
Thu, 05 Feb 2015 18:30:38 +0000 |
branch: master
commit 4c5f3ab1bff4707acdccea1191839f5943efbf08
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Fix first-run bug, passing js2-mode test.
---
context-coloring.el | 34 +++++++++++++++++++---------------
test/context-coloring-test.el | 4 +---
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 3f8b978..92b93a1 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -225,18 +225,22 @@ imply that it should be colorized again.")
;;; Scopification
-(let ((javascript-scopifier `(:type shell-command
- :executable "node"
- :command ,(expand-file-name
- "./languages/javascript/bin/scopifier"
- context-coloring-path)))
- (js2-scopifier `(:type elisp
- :scopifier context-coloring-js2-scopifier)))
- (defcustom context-coloring-scopifier-plist
- `(js-mode ,javascript-scopifier
- js2-mode ,js2-scopifier
- js3-mode ,javascript-scopifier)
- "Property list mapping major modes to scopification programs."))
+(defvar context-coloring-javascript-scopifier
+ `(:type shell-command
+ :executable "node"
+ :command ,(expand-file-name
+ "./languages/javascript/bin/scopifier"
+ context-coloring-path)))
+
+(defvar context-coloring-js2-scopifier
+ `(:type elisp
+ :scopifier context-coloring-js2-scopifier))
+
+(defcustom context-coloring-scopifier-plist
+ `(js-mode ,context-coloring-javascript-scopifier
+ js2-mode ,context-coloring-js2-scopifier
+ js3-mode ,context-coloring-javascript-scopifier)
+ "Property list mapping major modes to scopification programs.")
(defun context-coloring-apply-tokens (tokens)
"Processes a vector of TOKENS to apply context-based coloring
@@ -372,13 +376,13 @@ colorizing would be redundant."
;; Remember this buffer. This value should not be dynamically-bound.
(setq context-coloring-buffer (current-buffer))
- ;; Colorize once initially.
- (context-coloring-colorize)
-
;; Font lock is incompatible with this mode; the converse is also true.
(font-lock-mode 0)
(jit-lock-mode nil)
+ ;; Colorize once initially.
+ (context-coloring-colorize)
+
;; Only recolor on change.
(add-hook 'after-change-functions 'context-coloring-change-function nil t)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index b5ee05a..7c8709f 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -39,7 +39,6 @@ FIXTURE."
(ert-deftest context-coloring-test-unsupported-mode ()
(context-coloring-test-with-fixture
"./fixtures/function-scopes.js"
-
(context-coloring-mode)
(context-coloring-test-message-should-be
"Context coloring is not available for this major mode")))
@@ -63,7 +62,7 @@ FIXTURE."
"./fixtures/function-scopes.js"
(js-mode)
(context-coloring-mode)
- (sleep-for .25) ; Wait for asynchronous coloring.
+ (sleep-for .1) ; Wait for asynchronous coloring.
(context-coloring-test-function-scopes)))
(ert-deftest context-coloring-test-js2-mode-function-scopes ()
@@ -73,7 +72,6 @@ FIXTURE."
(require 'js2-mode)
(js2-mode)
(context-coloring-mode)
- (sleep-for .25) ; Wait for asynchronous coloring.
(context-coloring-test-function-scopes)))
(provide 'context-coloring-test)
- [elpa] master 43f2e3b 168/271: Increase reliability of async tests., (continued)
- [elpa] master 43f2e3b 168/271: Increase reliability of async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 28183e4 188/271: Readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master bdfdbe4 151/271: Improve benchmarks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d27f2fe 182/271: Fix callback removal., Jackson Ray Hamilton, 2015/02/05
- [elpa] master cb0644a 136/271: Cleanup JavaScript tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c1e9226 171/271: Reorganize lib., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e14226 135/271: Merge branch 'feature/language-generalization' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 7473cc9 169/271: Improve documentation and error handling for async tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b468d1c 166/271: Improve block scope test. Rename and document block scope variable., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d411168 175/271: Revert to single var., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4c5f3ab 145/271: Fix first-run bug, passing js2-mode test.,
Jackson Ray Hamilton <=
- [elpa] master 15bfad7 165/271: Renames., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4d73262 152/271: Speed up local name lookup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4fee39d 174/271: Remove .jslintrc files., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 903d938 176/271: Update readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d48e8cc 057/271: Add benchmark., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d157167 258/271: Strip headers. Use make dependencies., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 63e2590 207/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master d4ddaa6 160/271: Use edge js2-mode., Jackson Ray Hamilton, 2015/02/05
- [elpa] master ef461da 230/271: Stop maintaining benchmarks in readme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5e46686 173/271: Remove JS tests and benchmarks. Remove color schemer., Jackson Ray Hamilton, 2015/02/05