[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 284cfa6 08/47: Don't treat unbindables like variables.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 284cfa6 08/47: Don't treat unbindables like variables. |
Date: |
Mon, 18 May 2015 09:51:41 +0000 |
branch: master
commit 284cfa6f6743c270c6dc8e9a383c29e450ad3ade
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Don't treat unbindables like variables.
---
context-coloring.el | 6 ++++--
test/context-coloring-test.el | 5 +++++
test/fixtures/unbindable.el | 2 ++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index 92e4578..3bd2b0f 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -526,8 +526,10 @@ generated by `js2-mode'."
token-pos
variable-end))
(cond
- ;; Ignore numbers
- ((string-match-p "\\`[-+]?[0-9]" variable-string))
+ ;; Ignore constants such as numbers, keywords, t, nil. These can't
+ ;; be rebound, so they should be treated like syntax.
+ ((string-match-p "\\`[-+]?[0-9]\\|\\`t\\'\\|\\`nil\\'"
variable-string))
+ ((keywordp (read variable-string)))
(t
(setq variable (intern variable-string))
(setq variable-scope-level
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index 192d2ef..8e5b699 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -1077,6 +1077,11 @@ see that function."
:setup (lambda ()
(setq context-coloring-syntactic-strings t)))
+(context-coloring-test-deftest-emacs-lisp-mode unbindable
+ (lambda ()
+ (context-coloring-test-assert-region-level 20 40 1) ; 1 +1 -1 1.0 :a t nil
+ ))
+
(provide 'context-coloring-test)
;;; context-coloring-test.el ends here
diff --git a/test/fixtures/unbindable.el b/test/fixtures/unbindable.el
new file mode 100644
index 0000000..d5bb47f
--- /dev/null
+++ b/test/fixtures/unbindable.el
@@ -0,0 +1,2 @@
+(defun a ()
+ (+ a 1 +1 -1 1.0 :a t nil))
- [elpa] master updated (e42b97b -> b525e2d), Jackson Ray Hamilton, 2015/05/18
- [elpa] master 056be97 01/47: Add URL to header., Jackson Ray Hamilton, 2015/05/18
- [elpa] master eb429df 02/47: Use lowercase for hex codes., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 5e34bec 04/47: Cover malformed defun cases., Jackson Ray Hamilton, 2015/05/18
- [elpa] master d9d901f 03/47: Add basic elisp defun coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 8919acd 05/47: Add lambda coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 62506ae 06/47: Add quote and number coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 284cfa6 08/47: Don't treat unbindables like variables.,
Jackson Ray Hamilton <=
- [elpa] master 636e6b9 07/47: Add elisp comments and strings support., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 3e3141f 09/47: Refactor elisp tests to use visual assertions., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 171883f 13/47: Add let coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 58b7474 11/47: Don't color function calls as level 0., Jackson Ray Hamilton, 2015/05/18
- [elpa] master dd8d491 12/47: Also color defsubst., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 5acd088 10/47: Add non-recursive let* coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master c830ae5 15/47: Fix let* test., Jackson Ray Hamilton, 2015/05/18
- [elpa] master b4072c1 14/47: Trivial refactoring for clarity., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 926d74a 17/47: Include binding order in let* test., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 29328af 18/47: Add let test., Jackson Ray Hamilton, 2015/05/18