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

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

[elpa] externals/cape c4d821d55b 079/146: Add cape--symbol-annotation


From: ELPA Syncer
Subject: [elpa] externals/cape c4d821d55b 079/146: Add cape--symbol-annotation
Date: Sun, 9 Jan 2022 20:57:44 -0500 (EST)

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

    Add cape--symbol-annotation
---
 cape.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/cape.el b/cape.el
index 2eacef5664..d221ecc3c8 100644
--- a/cape.el
+++ b/cape.el
@@ -386,7 +386,7 @@ If INTERACTIVE is nil the function acts like a capf."
             :exclusive no ,@cape--file-properties))))))
 
 (defvar cape--symbol-properties
-  (list :annotation-function (lambda (_) " Symbol")
+  (list :annotation-function #'cape--symbol-annotation
         :company-kind #'cape--symbol-kind)
   "Completion extra properties for `cape-symbol'.")
 
@@ -401,6 +401,17 @@ If INTERACTIVE is nil the function acts like a capf."
    ((facep sym) 'color)
    (t 'text)))
 
+(defun cape--symbol-annotation (sym)
+  "Return kind of SYM."
+  (setq sym (intern-soft sym))
+  (cond
+   ((or (macrop sym) (special-form-p sym)) " Macro")
+   ((fboundp sym) " Function")
+   ((boundp sym) " Variable")
+   ((featurep sym) " Feature")
+   ((facep sym) " Face")
+   (t " Symbol")))
+
 ;;;###autoload
 (defun cape-symbol (&optional interactive)
   "Complete symbol at point.



reply via email to

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