[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 441f081a64: Allow using alists in ido completion and hitting TAB
From: |
Lars Ingebrigtsen |
Subject: |
master 441f081a64: Allow using alists in ido completion and hitting TAB |
Date: |
Tue, 14 Jun 2022 08:18:25 -0400 (EDT) |
branch: master
commit 441f081a643d6ad61208409fdcffe3a8a018f8ff
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Allow using alists in ido completion and hitting TAB
* lisp/ido.el (ido-completion-help): Allow using an alist
COMPLETIONS (bug#46091).
---
lisp/ido.el | 41 ++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/lisp/ido.el b/lisp/ido.el
index 73cd163d46..f970fce1ed 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3976,23 +3976,30 @@ If `ido-change-word-sub' cannot be found in WORD,
return nil."
(setq display-it t))
(if (and ido-completion-buffer display-it)
(with-output-to-temp-buffer ido-completion-buffer
- (let ((completion-list (sort
- (cond
- (ido-directory-too-big
- (message "Reading directory...")
- (setq ido-directory-too-big nil
- ido-ignored-list nil
- ido-cur-list (ido-all-completions)
- ido-rescan t)
- (ido-set-matches)
- (or ido-matches ido-cur-list))
- (ido-use-merged-list
- (ido-flatten-merged-list (or ido-matches
ido-cur-list)))
- ((or full-list
ido-completion-buffer-all-completions)
- (ido-all-completions))
- (t
- (copy-sequence (or ido-matches
ido-cur-list))))
- #'ido-file-lessp)))
+ (let* ((comps
+ (cond
+ (ido-directory-too-big
+ (message "Reading directory...")
+ (setq ido-directory-too-big nil
+ ido-ignored-list nil
+ ido-cur-list (ido-all-completions)
+ ido-rescan t)
+ (ido-set-matches)
+ (or ido-matches ido-cur-list))
+ (ido-use-merged-list
+ (ido-flatten-merged-list (or ido-matches ido-cur-list)))
+ ((or full-list ido-completion-buffer-all-completions)
+ (ido-all-completions))
+ (t
+ (copy-sequence (or ido-matches ido-cur-list)))))
+ (completion-list
+ ;; If we have an alist COMPLETIONS, transform to a
+ ;; simple list first.
+ (sort (if (and (consp comps)
+ (consp (car comps)))
+ (mapcar #'car comps)
+ comps)
+ #'ido-file-lessp)))
;;(add-hook 'completion-setup-hook #'completion-setup-function)
(display-completion-list completion-list))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 441f081a64: Allow using alists in ido completion and hitting TAB,
Lars Ingebrigtsen <=