Function: completion-metadata-get

completion-metadata-get is a byte-compiled function defined in minibuffer.el.gz.

Signature

(completion-metadata-get METADATA PROP)

Documentation

Get property PROP from completion METADATA.

If the metadata specifies a completion category, the variables completion-category-overrides and completion-category-defaults take precedence for category-specific overrides. If the completion metadata does not specify the property, the completion-extra-properties plist is consulted. Note that the keys of the completion-extra-properties plist are keyword symbols, not plain symbols.

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defun completion-metadata-get (metadata prop)
  "Get property PROP from completion METADATA.
If the metadata specifies a completion category, the variables
`completion-category-overrides' and
`completion-category-defaults' take precedence for
category-specific overrides.  If the completion metadata does not
specify the property, the `completion-extra-properties' plist is
consulted.  Note that the keys of the
`completion-extra-properties' plist are keyword symbols, not
plain symbols."
  (if-let* (((not (eq prop 'category)))
            (cat (completion--metadata-get-1 metadata 'category))
            (over (completion-category-get cat prop)))
      (cdr over)
    (completion--metadata-get-1 metadata prop)))