Skip to content

Commit

Permalink
Use completion-metadata-get from Compat 30
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Jul 8, 2024
1 parent 267d4c9 commit f958066
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion extensions/vertico-multiform.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The keys in LIST can be symbols or regexps."

(defun vertico-multiform--setup ()
"Enable modes at minibuffer setup."
(let ((cat (completion-metadata-get
(let ((cat (compat-call completion-metadata-get
(completion-metadata (buffer-substring-no-properties
(minibuffer-prompt-end)
(max (minibuffer-prompt-end) (point)))
Expand Down
8 changes: 3 additions & 5 deletions vertico.el
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,9 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED."

(defun vertico--affixate (cands)
"Annotate CANDS with annotation function."
(if-let ((aff (or (vertico--metadata-get 'affixation-function)
(plist-get completion-extra-properties :affixation-function))))
(if-let ((aff (vertico--metadata-get 'affixation-function)))
(funcall aff cands)
(if-let ((ann (or (vertico--metadata-get 'annotation-function)
(plist-get completion-extra-properties :annotation-function))))
(if-let ((ann (vertico--metadata-get 'annotation-function)))
(cl-loop for cand in cands collect
(let ((suff (or (funcall ann cand) "")))
;; The default completion UI adds the `completions-annotations'
Expand Down Expand Up @@ -302,7 +300,7 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and PRED."

(defun vertico--metadata-get (prop)
"Return PROP from completion metadata."
(completion-metadata-get vertico--metadata prop))
(compat-call completion-metadata-get vertico--metadata prop))

(defun vertico--sort-function ()
"Return the sorting function."
Expand Down

0 comments on commit f958066

Please sign in to comment.