[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ffb8c5d 21/27: Merge pull request #3 from plexus/add-elisp
From: |
Dmitry Gutov |
Subject: |
[elpa] master ffb8c5d 21/27: Merge pull request #3 from plexus/add-elisp-clojure |
Date: |
Sat, 29 Oct 2016 00:04:19 +0000 (UTC) |
branch: master
commit ffb8c5da19ffd2a71003b93fe33f78d0900fad9e
Merge: 083954e a031ee2
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Merge pull request #3 from plexus/add-elisp-clojure
Add Emacs Lisp and Clojure (same as Java)
---
highlight-escape-sequences.el | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/highlight-escape-sequences.el b/highlight-escape-sequences.el
index 8245b76..2c8d678 100644
--- a/highlight-escape-sequences.el
+++ b/highlight-escape-sequences.el
@@ -154,6 +154,23 @@ Currently doesn't handle \\C-, \\M-, etc.")
nil))
prepend))))
+(defconst hes-elisp-escape-sequence-re
+ (rx (submatch
+ (and ?\\ (submatch
+ (or
+ (and ?u (repeat 4 xdigit))
+ (and ?U ?0 ?0 (repeat 6 xdigit))
+ (and ?x (+ xdigit)) ;; variable number hex digits
+ (+ (in "0-7")) ;; variable number octal digits
+ not-newline)))))
+
+ "Regexp to match Emacs Lisp escape sequences.
+
+Currently handles:
+- unicodes (\\uNNNN and \\U00NNNNNN)
+- hexadecimal (\\x...) and octal (\\0-7), variable number of digits
+- backslash followed by anything else.")
+
(defun hes-make-simple-escape-sequence-keywords(re)
`((,re
(1 (when (nth 3 (syntax-ppss))
@@ -167,13 +184,15 @@ Currently doesn't handle \\C-, \\M-, etc.")
"Modes where escape sequences can appear in any string literal.")
(defcustom hes-mode-alist
- `((c-mode . ,hes-c/c++/objc-escape-sequence-re)
- (c++-mode . ,hes-c/c++/objc-escape-sequence-re)
- (objc-mode . ,hes-c/c++/objc-escape-sequence-re)
- (java-mode . ,hes-java-escape-sequence-re)
- (js-mode . ,hes-js-escape-sequence-re)
- (js2-mode . ,hes-js-escape-sequence-re)
- (ruby-mode . ,hes-ruby-escape-sequence-keywords))
+ `((c-mode . ,hes-c/c++/objc-escape-sequence-re)
+ (c++-mode . ,hes-c/c++/objc-escape-sequence-re)
+ (objc-mode . ,hes-c/c++/objc-escape-sequence-re)
+ (java-mode . ,hes-java-escape-sequence-re)
+ (clojure-mode . ,hes-java-escape-sequence-re)
+ (js-mode . ,hes-js-escape-sequence-re)
+ (js2-mode . ,hes-js-escape-sequence-re)
+ (ruby-mode . ,hes-ruby-escape-sequence-keywords)
+ (emacs-lisp-mode . ,hes-elisp-escape-sequence-re))
"Alist of regexps or `font-lock-keywords' elements for major modes."
:type '(repeat function)
:set (lambda (symbol value)
- [elpa] master 8098664 05/27: Add readme and screenshot, (continued)
- [elpa] master 8098664 05/27: Add readme and screenshot, Dmitry Gutov, 2016/10/28
- [elpa] master 5d45ca5 13/27: Fix the Author: header, Dmitry Gutov, 2016/10/28
- [elpa] master a031ee2 20/27: Add Emacs Lisp and Clojure (same as Java), Dmitry Gutov, 2016/10/28
- [elpa] master 083954e 19/27: Restore compatibility with earlier Emacsen, Dmitry Gutov, 2016/10/28
- [elpa] master 20d3190 22/27: Update copyright, Dmitry Gutov, 2016/10/28
- [elpa] master 02b8d09 10/27: Add more specific regexps, Dmitry Gutov, 2016/10/28
- [elpa] master 9c80a93 18/27: Merge pull request #1 from dev-plvlml/master, Dmitry Gutov, 2016/10/28
- [elpa] master 72c3cdc 07/27: Change wording, Dmitry Gutov, 2016/10/28
- [elpa] master 1e79174 11/27: Fix extra indent, Dmitry Gutov, 2016/10/28
- [elpa] master fa6dd96 24/27: Delete the obsolete alias, Dmitry Gutov, 2016/10/28
- [elpa] master ffb8c5d 21/27: Merge pull request #3 from plexus/add-elisp-clojure,
Dmitry Gutov <=
- [elpa] master 0e74c8c 27/27: Add hes to externals-list, Dmitry Gutov, 2016/10/28
- [elpa] master fc206ba 17/27: Untabify indents, Dmitry Gutov, 2016/10/28
- [elpa] master c3f28f2 25/27: Shorten some lines, Dmitry Gutov, 2016/10/28
- [elpa] master 9b2c607 26/27: Add 'packages/highlight-escape-sequences/' from commit 'c3f28f2003638e88e5cf0b03835412af7814f3b0', Dmitry Gutov, 2016/10/28
- [elpa] master 738f1e3 09/27: Add distinct regexps, Dmitry Gutov, 2016/10/28
- [elpa] master 460e92b 15/27: Add comments with the cases handled, Dmitry Gutov, 2016/10/28
- [elpa] master e86a466 23/27: Improve commentary, Dmitry Gutov, 2016/10/28
- [elpa] master aaabd19 14/27: Switch to rx macro, Dmitry Gutov, 2016/10/28