branch: externals/corfu commit 03558e1935156e2ca5181b5706ffb0177faa6148 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Bind completion-extra-properties in corfu--metadata-get --- corfu.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/corfu.el b/corfu.el index 1a9f2cb529..edb1a7a6f2 100644 --- a/corfu.el +++ b/corfu.el @@ -714,7 +714,8 @@ FRAME is the existing frame." (defun corfu--metadata-get (prop) "Return PROP from completion metadata." ;; Marginalia are too heavy for the popup. - (cl-letf (((symbol-function 'marginalia--completion-metadata-get) #'ignore)) + (cl-letf (((symbol-function 'marginalia--completion-metadata-get) #'ignore) + (completion-extra-properties (nth 4 completion-in-region--data))) (compat-call completion-metadata-get corfu--metadata prop))) (defun corfu--format-candidates (cands) @@ -1076,9 +1077,10 @@ A scroll bar is displayed from LO to LO+BAR." (cl-defgeneric corfu--affixate (cands) "Annotate CANDS with annotation function." - (let* ((completion-extra-properties (nth 4 completion-in-region--data)) - (dep (plist-get completion-extra-properties :company-deprecated)) - (mf (run-hook-with-args-until-success 'corfu-margin-formatters corfu--metadata))) + (let* ((extras (nth 4 completion-in-region--data)) + (dep (plist-get extras :company-deprecated)) + (mf (let ((completion-extra-properties extras)) + (run-hook-with-args-until-success 'corfu-margin-formatters corfu--metadata)))) (setq cands (if-let ((aff (corfu--metadata-get 'affixation-function))) (funcall aff cands)