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

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

[elpa] externals/cape 0a490abfbf: Combine predicates for super-capf test


From: ELPA Syncer
Subject: [elpa] externals/cape 0a490abfbf: Combine predicates for super-capf test/try-completion (#40)
Date: Tue, 17 May 2022 18:57:22 -0400 (EDT)

branch: externals/cape
commit 0a490abfbf89a24ceb148bdb8afbbd8823a2a201
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Combine predicates for super-capf test/try-completion (#40)
---
 cape.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/cape.el b/cape.el
index 50641d49f0..29e65f1775 100644
--- a/cape.el
+++ b/cape.el
@@ -560,8 +560,14 @@ If INTERACTIVE is nil the function acts like a Capf."
                    (copy-sequence cache-candidates))
                   (_
                    (completion--some
-                    (pcase-lambda (`(,table . ,_plist))
-                      (complete-with-action action table str pred))
+                    (pcase-lambda (`(,table . ,plist))
+                     (let* ((pr (plist-get plist :predicate))
+                            (pred (if pr
+                                      (if pred (lambda (x) ; satisfy both
+                                                 (and (funcall pred x) 
(funcall pr x)))
+                                        pr)
+                                    pred)))
+                       (complete-with-action action table str pred)))
                     tables))))
               :exclusive 'no
               :company-prefix-length prefix-len



reply via email to

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