From f9580665ce1b896f1ad6d9c6b7ceb47c748eb073 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Mon, 1 Apr 2024 13:30:13 +0200 Subject: [PATCH] Use completion-metadata-get from Compat 30 --- extensions/vertico-multiform.el | 2 +- vertico.el | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/extensions/vertico-multiform.el b/extensions/vertico-multiform.el index 58a0ead..830077e 100644 --- a/extensions/vertico-multiform.el +++ b/extensions/vertico-multiform.el @@ -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))) diff --git a/vertico.el b/vertico.el index 5109c8a..c9ba081 100644 --- a/vertico.el +++ b/vertico.el @@ -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' @@ -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."