[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 88a921f 35/47: Improve defun regexp.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master 88a921f 35/47: Improve defun regexp. |
Date: |
Mon, 18 May 2015 09:52:02 +0000 |
branch: master
commit 88a921f641dccc268b3b35f07abbea1d1d8e30a6
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Improve defun regexp.
---
context-coloring.el | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/context-coloring.el b/context-coloring.el
index ae5ed90..ead1a79 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -389,14 +389,26 @@ generated by `js2-mode'."
(defun context-coloring-stack-depth-equal (stack depth)
(= (plist-get (car stack) :depth) depth))
+(defun context-coloring-exact-regexp (word)
+ "Create a regexp that matches exactly WORD."
+ (concat "\\`" (regexp-quote word) "\\'"))
+
+(defun context-coloring-exact-or-regexp (words)
+ "Create a regexp that matches any exact word in WORDS."
+ (context-coloring-join
+ (mapcar 'context-coloring-exact-regexp words) "\\|"))
+
(defconst context-coloring-defun-regexp
- "\\`defun\\'\\|\\`defmacro\\'\\|\\`defsubst\\'")
+ (context-coloring-exact-or-regexp
+ '("defun" "defun*" "defsubst" "defmacro"
+ "cl-defun" "cl-defsubst" "cl-defmacro")))
(defconst context-coloring-arglist-arg-regexp
"\\`[^&:]")
(defconst context-coloring-ignored-word-regexp
- "\\`[-+]?[0-9]\\|\\`t\\'\\|\\`nil\\'\\|\\`\\.\\'\\|\\`\\?\\'")
+ (concat "\\`[-+]?[0-9]\\|" (context-coloring-exact-or-regexp
+ '("t" "nil" "." "?"))))
(defconst context-coloring-COMMA-CHAR 44)
(defconst context-coloring-BACKTICK-CHAR 96)
- [elpa] master dc2f9a6 25/47: Refactor maybe-colorize-comments-and-strings., (continued)
- [elpa] master dc2f9a6 25/47: Refactor maybe-colorize-comments-and-strings., Jackson Ray Hamilton, 2015/05/18
- [elpa] master a556195 26/47: Tweak iteration values, add logging., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 3fc5b20 27/47: Make dispatches fully redefinable., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 89f20e4 28/47: Improve interruptability of syntactic coloring., Jackson Ray Hamilton, 2015/05/18
- [elpa] master d24de46 31/47: Add TODO., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 07c5852 30/47: Add idle change teardown function., Jackson Ray Hamilton, 2015/05/18
- [elpa] master ef544ef 29/47: Fontify keywords., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 5c5b429 32/47: Fix font-lock error., Jackson Ray Hamilton, 2015/05/18
- [elpa] master c0a6689 33/47: Only set defaults when the mode is enabled., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 59a6c8e 34/47: Fix timer disposal and timer buffer detection., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 88a921f 35/47: Improve defun regexp.,
Jackson Ray Hamilton <=
- [elpa] master 438cb33 36/47: Fix incorrect last fontified position., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 1d7761c 37/47: Add constant comment test., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 4ff6e82 39/47: Remove verbose parsing., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 4bbce56 38/47: Add test for interruption., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 6392d1f 40/47: Bind optional parameters earlier., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 5051a70 42/47: Update documentation for emacs lisp., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 6a4ad31 43/47: Add derived mode support., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 3b6a391 44/47: Minor cleanup., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 708276e 41/47: Compiler micro-optimizations., Jackson Ray Hamilton, 2015/05/18
- [elpa] master 3bf805d 46/47: Version 6.3.0., Jackson Ray Hamilton, 2015/05/18