[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm f80e9d0215 2/5: Flatten list of candidates with helm-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm f80e9d0215 2/5: Flatten list of candidates with helm-comp-read-get-candidates |
Date: |
Fri, 4 Aug 2023 15:59:49 -0400 (EDT) |
branch: elpa/helm
commit f80e9d0215c1e42a9370465986481afb443c7fd4
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Flatten list of candidates with helm-comp-read-get-candidates
Completions may be given as a table composed with
completion-table-merge, so convert this table to a list of string and
remove its duplicates if some (often the case with completion-table-merge).
---
helm-mode.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/helm-mode.el b/helm-mode.el
index d6b6da56d7..cca36bded2 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -1879,17 +1879,16 @@ is used."
If both AFUN and AFIX are provided only AFIX is used.
When FILE-COMP-P is provided only filter out dot files."
- ;; Filter out dot files in file completion. Normally COMPS should be a list
of
- ;; string but in some cases it is given as a list of strings containing a
list
- ;; of string e.g. ("a" "b" "c" ("d" "e" "f")) ; This happen in rgrep
- ;; (bug#2607) and highlight-* fns (bug #2610), so ensure the list is
flattened to
- ;; avoid e.g. wrong-type argument: stringp '("d" "e" "f")
- ;; FIXME: If this create a new bug with completion-in-region, flatten COMPS
- ;; directly in the caller i.e. helm-completing-read-default-1.
+ ;; COMPS may be a list of strings or a table composed of different tables
made
+ ;; with `completion-table-merge'. This happen in rgrep (bug#2607),
highlight-*
+ ;; fns (bug #2610) and presumably in many other places, so ensure the table
is
+ ;; flattened to avoid having sublist in candidates list instead of
+ ;; strings. e.g. ("a" "b" "c" ("d" "e")) => ("a" "b" "c" "d" "e") .
(setq comps (helm-fast-remove-dups
- (helm-flatten-list comps)
+ (helm-comp-read-get-candidates comps)
:test 'equal))
(if file-comp-p
+ ;; Filter out dot files in file completion.
(cl-loop for f in comps
unless (string-match "\\`\\.\\{1,2\\}/\\'" f)
collect f)