[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 441dde0 178/271: Cleanup, comments.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 441dde0 178/271: Cleanup, comments. |
Date: |
Thu, 05 Feb 2015 18:30:59 +0000 |
branch: master
commit 441dde075747b1e78abbebc00ef9ffc4a454c5da
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Cleanup, comments.
---
context-coloring.el | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 7132083..565d568 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -34,7 +34,7 @@
;; To use, add the following to your ~/.emacs:
;; (require 'context-coloring)
-;; (add-hook 'js-mode-hook 'context-coloring-mode) ; Requires Node.js 0.10+.
+;; (add-hook 'js-mode-hook 'context-coloring-mode)
;;; Code:
@@ -228,27 +228,21 @@ For example: \"context-coloring-level-1-face\"."
(let ((type (js2-scope-type scope)))
(or (= type js2-SCRIPT)
(= type js2-FUNCTION)
- (= type js2-CATCH)
- (= type js2-WITH))))
+ (= type js2-CATCH))))
(setq level (+ level 1)))
(setq scope enclosing-scope))
level))
-;; Adapted from js2-refactor.el/js2r-vars.el
+;; Adapted from js2-refactor.el/js2r-vars.el.
+;; FIXME: This fails if there is whitespace between the name and the colon.
(defsubst context-coloring-js2-local-name-node-p (node)
(and (js2-name-node-p node)
(let ((start (js2-node-abs-pos node)))
(and
- ;; (save-excursion ; not key in object literal { key: value }
- ;; (goto-char (+ (js2-node-abs-pos node) (js2-node-len node)))
- ;; (looking-at "[\n\t ]*:"))
(let ((end (+ start (js2-node-len node))))
(not (string-match "[\n\t ]*:" (buffer-substring-no-properties
end
(+ end 1)))))
- ;; (save-excursion ; not property lookup on object
- ;; (goto-char (js2-node-abs-pos node))
- ;; (looking-back "\\.[\n\t ]*"))
(not (string-match "\\.[\n\t ]*" (buffer-substring-no-properties
(max 1 (- start 1)) ; 0 throws an
; error. ""
will
@@ -264,7 +258,6 @@ For example: \"context-coloring-level-1-face\"."
(defun context-coloring-js2-colorize ()
(with-silent-modifications
- ;; (context-coloring-uncolorize-buffer)
(js2-visit-ast
js2-mode-ast
(lambda (node end-p)
@@ -297,7 +290,6 @@ to the current buffer. Tokens are 3 integers: start, end,
level. The vector is flat, with a new token occurring after every
3rd element."
(with-silent-modifications
- ;; (context-coloring-uncolorize-buffer)
(let ((i 0)
(len (length tokens)))
(while (< i len)
@@ -458,9 +450,7 @@ colorizing would be redundant."
(jit-lock-mode nil)
;; Colorize once initially.
- ;; (let ((start-time (float-time)))
(context-coloring-colorize)
- ;; (message "Elapsed time: %f" (- (float-time) start-time)))
(cond
((equal major-mode 'js2-mode)
- [elpa] master 6059dca 179/271: Add Travis CI., (continued)
- [elpa] master 6059dca 179/271: Add Travis CI., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f2ace00 224/271: Add faces dynamically. Stop looping around at the last level., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d44b426 208/271: Merge branch 'master' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3cff176 210/271: Add failing key-value pair test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master e09d9ad 227/271: Add tests for comments and strings., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 21cc6c6 200/271: Save benchmark logs to an untracked directory., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 30a24f9 265/271: Add 'packages/context-coloring/' from commit 'f2b5d796d4dffc71b10503a8ae119bfa3274978e', Jackson Ray Hamilton, 2015/02/05
- [elpa] master 03d111c 235/271: Cleanup., Jackson Ray Hamilton, 2015/02/05
- [elpa] master eba74ae 192/271: Improve assertion functions., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 127b312 225/271: Remove rear-nonsticky., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 441dde0 178/271: Cleanup, comments.,
Jackson Ray Hamilton <=
- [elpa] master 9fb06d8 254/271: Merge branch 'master' into develop, Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5826178 239/271: Update the dispatch API., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3c8f842 195/271: Write failing property lookup test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4ac1eaa 242/271: Version 3.0.0., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b485897 186/271: Update benchmarks., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 9e177bf 268/271: Update headers and documentation for download-dependencies.el., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 48ff468 220/271: Update linter., Jackson Ray Hamilton, 2015/02/05
- [elpa] master a0fefc4 245/271: Add themes. Prepare for ELPA. Version 3.1.0., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 574b955 248/271: Update sentence spacing., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1f04586 172/271: Merge branch 'feature/js2-mode' into develop, Jackson Ray Hamilton, 2015/02/05