emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master a283883 24/79: Always colorize the remaining region.


From: Jackson Ray Hamilton
Subject: [elpa] master a283883 24/79: Always colorize the remaining region.
Date: Sun, 14 Jun 2015 00:05:25 +0000

branch: master
commit a283883546de74d5c19749611d56cea94b752dc2
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Always colorize the remaining region.
---
 context-coloring.el |   66 ++++++++++++++++++++++++++------------------------
 1 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 44f63dc..b000fd2 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -536,39 +536,41 @@ generated by `js2-mode'."
     (setq syntax-code (context-coloring-get-syntax-code))
     ;; Figure out if the sexp is a special form.
     (cond
-     ((or (= syntax-code context-coloring-WORD-CODE)
-          (= syntax-code context-coloring-SYMBOL-CODE))
-      (setq child-0-pos (point))
-      (forward-sexp)
-      (setq child-0-end (point))
-      (setq child-0-string (buffer-substring-no-properties
-                            child-0-pos
-                            child-0-end))
-      (cond
-       ((string-match-p context-coloring-elisp-defun-regexp child-0-string)
-        (goto-char start)
-        (context-coloring-elisp-colorize-defun))
-       ((string-match-p context-coloring-elisp-lambda-regexp child-0-string)
-        (goto-char start)
-        (context-coloring-elisp-colorize-lambda))
-       ((string-match-p context-coloring-elisp-let-regexp child-0-string)
-        (goto-char start)
-        (context-coloring-elisp-colorize-let))
-       ((string-match-p context-coloring-elisp-let*-regexp child-0-string)
-        (goto-char start)
-        (context-coloring-elisp-colorize-let*))
-       ;; Not a special form; just colorize the remaining region.
-       (t
-        (context-coloring-colorize-region
-         start
-         end
-         (context-coloring-elisp-current-scope-level))
-        (context-coloring-elisp-colorize-region (point) (1- end))
-        (forward-char))))
+     ((when (or (= syntax-code context-coloring-WORD-CODE)
+                (= syntax-code context-coloring-SYMBOL-CODE))
+        (setq child-0-pos (point))
+        (forward-sexp)
+        (setq child-0-end (point))
+        (setq child-0-string (buffer-substring-no-properties
+                              child-0-pos
+                              child-0-end))
+        (cond
+         ((string-match-p context-coloring-elisp-defun-regexp child-0-string)
+          (goto-char start)
+          (context-coloring-elisp-colorize-defun)
+          t)
+         ((string-match-p context-coloring-elisp-lambda-regexp child-0-string)
+          (goto-char start)
+          (context-coloring-elisp-colorize-lambda)
+          t)
+         ((string-match-p context-coloring-elisp-let-regexp child-0-string)
+          (goto-char start)
+          (context-coloring-elisp-colorize-let)
+          t)
+         ((string-match-p context-coloring-elisp-let*-regexp child-0-string)
+          (goto-char start)
+          (context-coloring-elisp-colorize-let*)
+          t)
+         (t
+          nil))))
+     ;; Not a special form; just colorize the remaining region.
      (t
-      ;; Skip it.
-      (goto-char start)
-      (forward-sexp)))))
+      (context-coloring-colorize-region
+       start
+       end
+       (context-coloring-elisp-current-scope-level))
+      (context-coloring-elisp-colorize-region (point) (1- end))
+      (forward-char)))))
 
 (defun context-coloring-elisp-colorize-symbol ()
   (let (symbol-pos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]