[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 03d111c 235/271: Cleanup.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 03d111c 235/271: Cleanup. |
Date: |
Thu, 05 Feb 2015 18:31:33 +0000 |
branch: master
commit 03d111c98388166d863c0f05c0db5909085ea01c
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Cleanup.
---
context-coloring.el | 9 +++++-
test/context-coloring-test.el | 52 +++++++++++++++++++++++++++++-----------
2 files changed, 44 insertions(+), 17 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index f0b1865..1405341 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -120,6 +120,7 @@ used.")
(context-coloring-set-colors-default)
+
;;; Face functions
(defsubst context-coloring-face-symbol (level)
@@ -155,6 +156,8 @@ END (exclusive) with the face corresponding to LEVEL."
`(face ,(context-coloring-level-face level))))
(defsubst context-coloring-maybe-colorize-comments-and-strings ()
+ "Colorizes the current buffer's comments and strings if
+`context-coloring-comments-and-strings' is non-nil."
(when context-coloring-comments-and-strings
(save-excursion
(font-lock-fontify-syntactically-region (point-min) (point-max)))))
@@ -316,11 +319,13 @@ Invokes CALLBACK when complete."
:executable "node"
:command ,(expand-file-name
"./languages/javascript/binaries/scopifier"
- context-coloring-path)))
+ context-coloring-path))
+ "JavaScript scopifier via Node.js.")
(defvar context-coloring-js2-colorizer
`(:type elisp
- :colorizer context-coloring-js2-colorize))
+ :colorizer context-coloring-js2-colorize)
+ "JavaScript colorizer via `js2-mode'.")
(defcustom context-coloring-dispatch-plist
`(js-mode ,context-coloring-javascript-scopifier
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index b7dda76..9137437 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -103,33 +103,51 @@ to run arbitrary code before the mode is invoked."
(context-coloring-test-assert-region
(when (not (when face
(let* ((face-string (symbol-name face))
- (matches (string-match
context-coloring-test-level-regexp face-string)))
+ (matches (string-match
+ context-coloring-test-level-regexp
+ face-string)))
(when matches
- (setq actual-level (string-to-number (substring face-string
-
(match-beginning 1)
- (match-end
1))))
+ (setq actual-level (string-to-number
+ (substring face-string
+ (match-beginning 1)
+ (match-end 1))))
(= level actual-level)))))
- (ert-fail (format "Expected level in region [%s, %s), which is \"%s\", to
be %s; but at point %s, it was %s"
- start end (buffer-substring-no-properties start end)
level point actual-level)))))
+ (ert-fail (format (concat "Expected level in region [%s, %s), "
+ "which is \"%s\", to be %s; "
+ "but at point %s, it was %s")
+ start end
+ (buffer-substring-no-properties start end) level
+ point actual-level)))))
(defun context-coloring-test-assert-region-face (start end expected-face)
(context-coloring-test-assert-region
(when (not (eq face expected-face))
- (ert-fail (format "Expected face in region [%s, %s), which is \"%s\", to
be %s; but at point %s, it was %s"
- start end (buffer-substring-no-properties start end)
expected-face point face)))))
+ (ert-fail (format (concat "Expected face in region [%s, %s), "
+ "which is \"%s\", to be %s; "
+ "but at point %s, it was %s")
+ start end
+ (buffer-substring-no-properties start end) expected-face
+ point face)))))
(defun context-coloring-test-assert-region-comment-delimiter (start end)
- (context-coloring-test-assert-region-face start end
'font-lock-comment-delimiter-face))
+ (context-coloring-test-assert-region-face
+ start end 'font-lock-comment-delimiter-face))
(defun context-coloring-test-assert-region-comment (start end)
- (context-coloring-test-assert-region-face start end 'font-lock-comment-face))
+ (context-coloring-test-assert-region-face
+ start end 'font-lock-comment-face))
(defun context-coloring-test-assert-region-string (start end)
- (context-coloring-test-assert-region-face start end 'font-lock-string-face))
+ (context-coloring-test-assert-region-face
+ start end 'font-lock-string-face))
(defun context-coloring-test-assert-message (expected)
(with-current-buffer "*Messages*"
- (let ((messages (split-string (buffer-substring-no-properties (point-min)
(point-max)) "\n")))
+ (let ((messages (split-string
+ (buffer-substring-no-properties
+ (point-min)
+ (point-max))
+ "\n")))
(let ((message (car (nthcdr (- (length messages) 2) messages))))
(should (equal message expected))))))
@@ -144,11 +162,15 @@ to run arbitrary code before the mode is invoked."
(let* ((face (context-coloring-face-symbol level))
actual-foreground)
(when (not face)
- (ert-fail (format "Expected face for level `%s' to exist; but it didn't"
level)))
+ (ert-fail (format (concat "Expected face for level `%s' to exist; "
+ "but it didn't")
+ level)))
(setq actual-foreground (face-attribute face :foreground))
(when (not (string-equal foreground actual-foreground))
- (ert-fail (format "Expected face for level `%s' to have foreground `%s';
but it was `%s'"
- level foreground actual-foreground)))))
+ (ert-fail (format (concat "Expected face for level `%s' "
+ "to have foreground `%s'; but it was `%s'")
+ level
+ foreground actual-foreground)))))
(ert-deftest context-coloring-test-set-colors ()
;; This test has an irreversible side-effect in that it defines faces beyond
- [elpa] master 31ee972 197/271: Improve property lookup test., (continued)
- [elpa] master 31ee972 197/271: Improve property lookup test., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3d034f9 262/271: Merge branch 'develop', Jackson Ray Hamilton, 2015/02/05
- [elpa] master 6d24750 206/271: Update docs., Jackson Ray Hamilton, 2015/02/05
- [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 <=
- [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, 2015/02/05
- [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