summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar AntolĂ­n Camarena <omar.antolin@gmail.com>2021-11-25 08:37:42 -0600
committerGitHub <noreply@github.com>2021-11-25 08:37:42 -0600
commitc8731aacfaa92aceda0a2c060c78a75a6b443874 (patch)
tree9f864ebd1247891c406eabe744bbd66a926c1d5c
parent8cea82b6d395078d0105f4957d4a95206dc9c7ba (diff)
parentc615334c79660a5e6876ee6147740eef56824320 (diff)
Merge pull request #98 from minad/fix-try
Fix orderless-try-completion for hash tables and alists
-rw-r--r--orderless.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/orderless.el b/orderless.el
index 9250756..d24e3b5 100644
--- a/orderless.el
+++ b/orderless.el
@@ -464,11 +464,14 @@ 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 (car args) ;; first argument is key
+ one (if (consp args) (car args) args) ;; alist
+ one (if (symbolp one) (symbol-name one) one)))
nil))
(when one
(if (equal string one)