branch: master commit a283883546de74d5c19749611d56cea94b752dc2 Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> Commit: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com>
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