branch: externals/marginalia
commit f3eaa1a0372c54295a3ae9b800527d58c991ff3d
Author: Omar Antolín <[email protected]>
Commit: Omar Antolín <[email protected]>
Add annotator for the embark-keybinding category
---
marginalia.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/marginalia.el b/marginalia.el
index d65e66b..2402283 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -110,6 +110,7 @@ See also `marginalia-annotators-heavy'."
(project-file . marginalia-annotate-project-file)
(buffer . marginalia-annotate-buffer)
(command . marginalia-annotate-command)
+ (embark-keybinding . marginalia-annotate-embark-keybinding)
(consult-multi . marginalia-annotate-consult-multi))
marginalia-annotators-light)
"Heavy annotator functions.
@@ -439,6 +440,13 @@ Similar to `marginalia-annotate-symbol', but does not show
symbol class."
(marginalia-annotate-binding cand)
(marginalia--documentation (marginalia--function-doc sym)))))
+(defun marginalia-annotate-embark-keybinding (cand)
+ "Annotate Embark keybinding CAND with its documentation string.
+Similar to `marginalia-annotate-command', but does not show the
+keybinding since CAND includes it."
+ (when-let (cmd (get-text-property 0 'embark-command cand))
+ (marginalia--documentation (marginalia--function-doc cmd))))
+
(defun marginalia-annotate-imenu (cand)
"Annotate imenu CAND with its documentation string."
(when (derived-mode-p 'emacs-lisp-mode)