Function: consult--multi-format

consult--multi-format is a natively compiled function defined in consult.el.

Signature

(consult--multi-format IDX SRC ITEMS)

Documentation

Format completion candidate strings from ITEMS.

Attach source IDX and SRC properties to each item.

Source Code

;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult--multi-format (idx src items)
  "Format completion candidate strings from ITEMS.
Attach source IDX and SRC properties to each item."
  (let ((face (plist-get src :face))
        (cat (or (plist-get src :category) 'general)))
    (cl-loop
     for item in items collect
     (let* ((str (or (car-safe item) item))
            (len (length str))
            (cand (consult--tofu-append str idx)))
       ;; Preserve existing `multi-category' datum of the candidate.
       (unless (and (eq str item) (get-text-property 0 'multi-category str))
         (put-text-property 0 len 'multi-category (cons cat (or (cdr-safe item) item)) cand))
       (when face
         (add-face-text-property 0 len face t cand))
       cand))))