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

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

[nongnu] elpa/hyperdrive 66e04a0164 1/7: Change: (hyperdrive-complete-hy


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 66e04a0164 1/7: Change: (hyperdrive-complete-hyperdrive) Add completion category
Date: Sun, 12 Nov 2023 06:59:56 -0500 (EST)

branch: elpa/hyperdrive
commit 66e04a0164731d84c829bbe268b1fc34cd67c080
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Change: (hyperdrive-complete-hyperdrive) Add completion category
    
    This change allows users to override completion-styles and
    completion-cycle-threshold when completing hyperdrives.  It also
    allows for Embark integration.
---
 hyperdrive-lib.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index e458ae907d..78c7f21a4a 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1064,7 +1064,15 @@ case, when PREDICATE, only offer hyperdrives matching 
it."
                                (cons (hyperdrive--format-hyperdrive 
hyperdrive) hyperdrive))
                              hyperdrives))
          (completion-styles (cons 'substring completion-styles))
-         (selected (completing-read prompt candidates nil 'require-match nil 
nil default)))
+         (selected
+          (completing-read
+           prompt
+           (lambda (string predicate action)
+             (if (eq action 'metadata)
+                 '(metadata (category . hyperdrive))
+               (complete-with-action
+                action candidates string predicate)))
+           nil 'require-match nil nil default)))
     (or (alist-get selected candidates nil nil #'equal)
         (hyperdrive-user-error "No such hyperdrive.  Use `hyperdrive-new' to 
create a new one"))))
 



reply via email to

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