(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