[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia ba0753ba81: Support generic multi-category (
From: |
ELPA Syncer |
Subject: |
[elpa] externals/marginalia ba0753ba81: Support generic multi-category (#119) |
Date: |
Wed, 29 Dec 2021 13:57:57 -0500 (EST) |
branch: externals/marginalia
commit ba0753ba814ff9adf4ebde1c02cd69abbc19b169
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: GitHub <noreply@github.com>
Support generic multi-category (#119)
---
marginalia.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/marginalia.el b/marginalia.el
index 3ec1edca6d..98826c3c38 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -99,7 +99,9 @@ a relative age."
(file marginalia-annotate-file)
(project-file marginalia-annotate-project-file)
(buffer marginalia-annotate-buffer)
- (consult-multi marginalia-annotate-consult-multi)))
+ (multi-category marginalia-annotate-multi-category)
+ ;; TODO: `consult-multi' has been obsoleted by `multi-category'. Remove!
+ (consult-multi marginalia-annotate-multi-category)))
"Annotator function registry.
Associates completion categories with annotation functions.
Each annotation function must return a string,
@@ -401,12 +403,13 @@ WIDTH is the format width. This can be specified as
alternative to FORMAT."
('builtin nil)
(fun fun)))
-;; This annotator is consult-specific, it will annotate commands with
`consult-multi' category
-(defun marginalia-annotate-consult-multi (cand)
- "Annotate consult-multi CAND with the buffer class."
- (if-let* ((multi (get-text-property 0 'consult-multi cand))
+(defun marginalia-annotate-multi-category (cand)
+ "Annotate multi-category CAND with the buffer class."
+ (if-let* ((multi (or (get-text-property 0 'multi-category cand)
+ ;; TODO: `consult-multi' has been obsoleted by
`multi-category'. Remove!
+ (get-text-property 0 'consult-multi cand)))
(annotate (marginalia--annotator (car multi))))
- ;; Use the Marginalia annotator corresponding to the consult-multi
category.
+ ;; Use the Marginalia annotator corresponding to the multi category.
(funcall annotate (cdr multi))
;; Apply the original annotation function on the original candidate, if
there is one.
;; NOTE: Use `alist-get' instead of `completion-metadata-get' to bypass our
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/marginalia ba0753ba81: Support generic multi-category (#119),
ELPA Syncer <=