Function: eca-chat--schedule-fontify

eca-chat--schedule-fontify is a natively compiled function defined in eca-chat.el.

Signature

(eca-chat--schedule-fontify)

Documentation

Schedule a deferred font-lock-ensure for the current chat buffer.

Cancels any previously scheduled timer. Does nothing when eca-chat-fontify-debounce-interval is nil, letting jit-lock cover visible-area fontification and relying on the final ensure at end-of-stream for correctness.

The scoped region runs from eca-chat--last-user-message-pos (the start of the current turn) to point-max, so cost is bounded by the new turn instead of the full chat history.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-chat.el
(defun eca-chat--schedule-fontify ()
  "Schedule a deferred `font-lock-ensure' for the current chat buffer.
Cancels any previously scheduled timer.  Does nothing when
`eca-chat-fontify-debounce-interval' is nil, letting jit-lock cover
visible-area fontification and relying on the final ensure at
end-of-stream for correctness.

The scoped region runs from `eca-chat--last-user-message-pos' (the
start of the current turn) to `point-max', so cost is bounded by
the new turn instead of the full chat history."
  (when (timerp eca-chat--fontify-timer)
    (cancel-timer eca-chat--fontify-timer))
  (setq eca-chat--fontify-timer nil)
  (when (numberp eca-chat-fontify-debounce-interval)
    (let ((buf (current-buffer)))
      (setq eca-chat--fontify-timer
            (run-with-idle-timer
             eca-chat-fontify-debounce-interval nil
             (lambda ()
               (when (buffer-live-p buf)
                 (with-current-buffer buf
                   (setq eca-chat--fontify-timer nil)
                   (eca-chat--font-lock-ensure
                    (or eca-chat--last-user-message-pos (point-min))
                    (point-max))))))))))