branch: externals/orderless
commit 1e59cf2b9cb6d6c6e8753c82f285177b4e27a01d
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Fix orderless-try-completion for hash tables and alists
---
 orderless.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/orderless.el b/orderless.el
index 9250756688..09ef368f81 100644
--- a/orderless.el
+++ b/orderless.el
@@ -464,11 +464,16 @@ This function is part of the `orderless' completion 
style."
       ;; Should be more or less allocation-free since our "predicate"
       ;; always returns nil.
       (orderless-filter string table
-                        (lambda (str)
-                          (when (or (not pred) (funcall pred str))
+                        ;; key/value for hash tables
+                        (lambda (&rest args)
+                          (when (or (not pred) (apply pred args))
                             (when one
                               (throw 'orderless--many (cons string point)))
-                            (setq one str))
+                            (setq one (pcase-exhaustive args
+                                        (`((,key . ,_val)) key) ;; alists
+                                        (`(,str) str) ;; strings/symbols
+                                        (`(,key ,_val) key)) ;; hash tables
+                                  one (if (symbolp one) (symbol-name one) 
one)))
                           nil))
       (when one
         (if (equal string one)

Reply via email to