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

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

[elpa] externals/cape de72ab685a: Add cape--symbol-predicate


From: ELPA Syncer
Subject: [elpa] externals/cape de72ab685a: Add cape--symbol-predicate
Date: Sun, 4 Dec 2022 09:57:20 -0500 (EST)

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

    Add cape--symbol-predicate
---
 cape.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cape.el b/cape.el
index c32b759009..46262faaf4 100644
--- a/cape.el
+++ b/cape.el
@@ -289,6 +289,7 @@ If INTERACTIVE is nil the function acts like a Capf."
   (append
    (list :annotation-function #'cape--symbol-annotation
          :exit-function #'cape--symbol-exit
+         :predicate #'cape--symbol-predicate
          :exclusive 'no)
    (when (>= emacs-major-version 28)
      (autoload 'elisp--company-kind "elisp-mode")
@@ -301,6 +302,10 @@ If INTERACTIVE is nil the function acts like a Capf."
            :company-location 'elisp--company-location)))
   "Completion extra properties for `cape-symbol'.")
 
+(defun cape--symbol-predicate (sym)
+  "Return t if SYM is bound, fbound or propertized."
+  (or (fboundp sym) (boundp sym) (symbol-plist sym)))
+
 (defun cape--symbol-exit (name status)
   "Wrap symbol NAME with `cape-symbol-wrapper' buffers.
 STATUS is the exit status."



reply via email to

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