Function: cider-font-lock-as

cider-font-lock-as is a byte-compiled function defined in cider-util.el.

Signature

(cider-font-lock-as MODE STRING)

Documentation

Use MODE to font-lock the STRING.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-util.el
(defun cider-font-lock-as (mode string)
  "Use MODE to font-lock the STRING."
  (let ((string (if (cider-ansi-color-string-p string)
                    (substring-no-properties (ansi-color-apply string))
                  string)))
    (if (or (null cider-font-lock-max-length)
            (< (length string) cider-font-lock-max-length))
        (with-current-buffer (cider--make-buffer-for-mode mode)
          (erase-buffer)
          (insert string)
          ;; don't try to font-lock unbalanced Clojure code
          (when (eq mode 'clojure-mode)
            (check-parens))
          (font-lock-fontify-region (point-min) (point-max))
          (buffer-string))
      string)))