diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-04-01 13:26:23 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-07-08 23:38:20 +0200 |
| commit | daab849b05ace651df195617303e152f928980f7 (patch) | |
| tree | e14e4e6305994f054ef411e4f4e08510276222e5 | |
| parent | 53f656cbddd2beb3098943f590893ec81d32722e (diff) | |
Use completion-metadata-get from Compat 30
| -rw-r--r-- | corfu.el | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -713,9 +713,9 @@ FRAME is the existing frame." (defun corfu--metadata-get (prop) "Return PROP from completion metadata." - ;; Note: Do not use `completion-metadata-get' in order to avoid Marginalia. - ;; The Marginalia annotators are too heavy for the Corfu popup! - (cdr (assq prop corfu--metadata))) + ;; Marginalia are too heavy for the popup. + (cl-letf (((symbol-function 'marginalia--completion-metadata-get) #'ignore)) + (compat-call completion-metadata-get corfu--metadata prop))) (defun corfu--format-candidates (cands) "Format annotated CANDS." @@ -1080,11 +1080,9 @@ A scroll bar is displayed from LO to LO+BAR." (dep (plist-get completion-extra-properties :company-deprecated)) (mf (run-hook-with-args-until-success 'corfu-margin-formatters corfu--metadata))) (setq cands - (if-let ((aff (or (corfu--metadata-get 'affixation-function) - (plist-get completion-extra-properties :affixation-function)))) + (if-let ((aff (corfu--metadata-get 'affixation-function))) (funcall aff cands) - (if-let ((ann (or (corfu--metadata-get 'annotation-function) - (plist-get completion-extra-properties :annotation-function)))) + (if-let ((ann (corfu--metadata-get 'annotation-function))) (cl-loop for cand in cands collect (let ((suff (or (funcall ann cand) ""))) ;; The default completion UI adds the |
