Function: eca-chat-inline--fontified-body

eca-chat-inline--fontified-body is a natively compiled function defined in eca-chat-inline.el.

Signature

(eca-chat-inline--fontified-body OV)

Documentation

Return the markdown-fontified answer body for OV, or nil.

Rendered like the chat buffer: fenced code blocks are natively highlighted and, per eca-chat-hide-markdown-markup, the markdown markup is hidden. Long lines are hard-wrapped to eca-chat-inline-wrap-column since overlay strings cannot be hscrolled.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat-inline.el
(defun eca-chat-inline--fontified-body (ov)
  "Return the markdown-fontified answer body for OV, or nil.
Rendered like the chat buffer: fenced code blocks are natively
highlighted and, per `eca-chat-hide-markdown-markup', the
markdown markup is hidden.  Long lines are hard-wrapped to
`eca-chat-inline-wrap-column' since overlay strings cannot be
hscrolled."
  (let ((acc (overlay-get ov 'eca-chat-inline--text-acc))
        (temp (overlay-get ov 'eca-chat-inline--temp-buffer)))
    (when (and (buffer-live-p temp)
               (not (string-empty-p (string-trim acc))))
      (with-current-buffer temp
        (let ((inhibit-read-only t)
              (inhibit-modification-hooks t))
          (erase-buffer)
          (insert (string-trim acc))
          (unless (derived-mode-p 'gfm-mode)
            (delay-mode-hooks (gfm-mode)))
          ;; Both are consulted at fontification time.
          (setq-local markdown-fontify-code-blocks-natively t)
          (setq-local markdown-hide-markup
                      (and eca-chat-hide-markdown-markup t))
          (font-lock-ensure)
          ;; Normalize the spec so `invisible-p' during wrapping
          ;; sees exactly what the overlay will hide.
          (setq buffer-invisibility-spec
                (when eca-chat-hide-markdown-markup '(markdown-markup)))
          (eca-chat-inline--wrap-lines (eca-chat-inline--wrap-width ov)))
        (eca-chat-inline--remap-invisible (buffer-string))))))