emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/marginalia b0c24f7 088/241: introduce marginalia-annota


From: Stefan Monnier
Subject: [elpa] externals/marginalia b0c24f7 088/241: introduce marginalia-annotate-command
Date: Fri, 28 May 2021 20:49:02 -0400 (EDT)

branch: externals/marginalia
commit b0c24f76e1b450dd178ae3ce54401dc43e43821d
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    introduce marginalia-annotate-command
    
    Like marginalia-annotate-symbol, but does not show symbol-class.
    The symbol-class feels like unnecessary noise for M-x.
---
 marginalia.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/marginalia.el b/marginalia.el
index 96375a1..c34628b 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -170,7 +170,7 @@ See also `marginalia-annotators-heavy'."
    '((file . marginalia-annotate-file)
      (buffer . marginalia-annotate-buffer)
      (virtual-buffer . marginalia-annotate-virtual-buffer-full)
-     (command . marginalia-annotate-symbol))
+     (command . marginalia-annotate-command))
    marginalia-annotators-light)
   "Heavy annotator functions.
 
@@ -382,6 +382,14 @@ a face"
         (t (documentation-property sym 'variable-documentation)))
        :truncate marginalia-truncate-width :face 'marginalia-documentation)))))
 
+(defun marginalia-annotate-command (cand)
+  "Annotate command CAND with its documentation string.
+Similar to `marginalia-annotate-symbol', but does not show symbol class."
+  (when-let (sym (intern-soft cand))
+    (concat
+     (marginalia-annotate-binding cand)
+     (marginalia--documentation (marginalia--function-doc sym)))))
+
 (defun marginalia-annotate-imenu (cand)
   "Annotate imenu CAND with its documentation string."
   (when (provided-mode-derived-p (buffer-local-value 'major-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]