Function: marginalia--completion-metadata-get

marginalia--completion-metadata-get is a natively compiled function defined in marginalia.el.

Signature

(marginalia--completion-metadata-get METADATA PROP)

Documentation

Meant as :before-until advice for completion-metadata-get.

METADATA is the metadata. PROP is the property which is looked up.

Source Code

;; Defined in /nix/store/hym71by08nv7fpgl7asan3dvidx05yya-emacs-packages-deps/share/emacs/site-lisp/elpa/marginalia-20260926.1228/marginalia.el
(defun marginalia--completion-metadata-get (metadata prop)
  "Meant as :before-until advice for `completion-metadata-get'.
METADATA is the metadata.
PROP is the property which is looked up."
  (pcase prop
    ('affixation-function
     ;; We do want the advice triggered for `completion-metadata-get'.
     (when-let* ((cat (completion-metadata-get metadata 'category))
                 (annotator (marginalia--annotator cat)))
       (apply-partially #'marginalia--affixate metadata annotator)))
    ('category
     ;; Find the completion category by trying each of our classifiers.
     ;; Store the metadata for `marginalia-classify-original-category'.
     (let ((marginalia--metadata metadata))
       (run-hook-with-args-until-success 'marginalia-classifiers)))))