1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

* lisp/progmodes/grep.el (grep-read-files): Combine files with aliases.

Use completion-table-merge to combine completions of files from
read-file-name-internal with a list of defaults from grep-files-aliases
(bug#55800).
This commit is contained in:
Juri Linkov 2022-06-13 20:19:32 +03:00
parent abe75e5520
commit 7fdb53ddaf

View File

@ -1066,15 +1066,18 @@ REGEXP is used as a string in the prompt."
default-extension
(car grep-files-history)
(car (car grep-files-aliases))))
(defaults
(delete-dups
(delq nil
(append (list default default-alias default-extension)
(mapcar #'car grep-files-aliases)))))
(files (completing-read
(format-prompt "Search for \"%s\" in files matching wildcard"
default regexp)
#'read-file-name-internal
nil nil nil 'grep-files-history
(delete-dups
(delq nil
(append (list default default-alias default-extension)
(mapcar #'car grep-files-aliases)))))))
(completion-table-merge
(lambda (_string _pred _action) defaults)
#'read-file-name-internal)
nil nil nil 'grep-files-history defaults)))
(and files
(or (cdr (assoc files grep-files-aliases))
files))))