[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a031ee2 20/27: Add Emacs Lisp and Clojure (same as Java)
From: |
Dmitry Gutov |
Subject: |
[elpa] master a031ee2 20/27: Add Emacs Lisp and Clojure (same as Java) |
Date: |
Sat, 29 Oct 2016 00:04:19 +0000 (UTC) |
branch: master
commit a031ee2dcdc7f24d04b27002d2066af86a0ee94d
Author: Arne Brasseur <address@hidden>
Commit: Arne Brasseur <address@hidden>
Add Emacs Lisp and Clojure (same as Java)
Add a new regexp to match Emacs Lisp strings.
Clojure strings are Java strings, so for Clojure we can reuse the Java
regexp.
---
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 7777860 03/27: Autoload the mode function, (continued)
- [elpa] master 7777860 03/27: Autoload the mode function, Dmitry Gutov, 2016/10/28
- [elpa] master 74340d0 02/27: hes-ruby-keywords, fallback predicate: Allow in backquoted literals, Dmitry Gutov, 2016/10/28
- [elpa] master 4425527 04/27: hes-simple-mode setter: Fix initialization; turn on when needed, Dmitry Gutov, 2016/10/28
- [elpa] master f7a0074 06/27: Wrong words on the screenshot, Dmitry Gutov, 2016/10/28
- [elpa] master 0df3e63 12/27: Remove explicit group, Dmitry Gutov, 2016/10/28
- [elpa] master 6bc14c4 16/27: Beautify hes-ruby-escape-sequence-keywords, Dmitry Gutov, 2016/10/28
- [elpa] master 828cdbb 08/27: Improve regexp and add two faces, Dmitry Gutov, 2016/10/28
- [elpa] master fc8f4e7 01/27: Initial commit, Dmitry Gutov, 2016/10/28
- [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 <=
- [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, 2016/10/28
- [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