Function: eca-completion--prepare-display-text

eca-completion--prepare-display-text is a natively compiled function defined in eca-completion.el.

Signature

(eca-completion--prepare-display-text TEXT)

Documentation

Return TEXT prepared for the inline overlay.

Applies syntax fontification and foreground dimming according to eca-completion-syntax-highlight and eca-completion-overlay-dim-ratio. The returned string is safe to mutate and does not yet carry eca-completion-overlay-face.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-completion.el
(defun eca-completion--prepare-display-text (text)
  "Return TEXT prepared for the inline overlay.
Applies syntax fontification and foreground dimming according to
`eca-completion-syntax-highlight' and
`eca-completion-overlay-dim-ratio'.  The returned string is safe
to mutate and does not yet carry `eca-completion-overlay-face'."
  (let ((mode major-mode)
        (bg (face-background 'default nil 'default)))
    (cond
     ((and eca-completion-syntax-highlight
           (numberp eca-completion-overlay-dim-ratio))
      (eca-completion--dim-fontified
       (eca-completion--fontify-as-mode text mode)
       bg
       eca-completion-overlay-dim-ratio))
     (eca-completion-syntax-highlight
      (eca-completion--fontify-as-mode text mode))
     (t (copy-sequence text)))))