mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-01 08:17:38 +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:
parent
abe75e5520
commit
7fdb53ddaf
@ -1066,15 +1066,18 @@ REGEXP is used as a string in the prompt."
|
|||||||
default-extension
|
default-extension
|
||||||
(car grep-files-history)
|
(car grep-files-history)
|
||||||
(car (car grep-files-aliases))))
|
(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
|
(files (completing-read
|
||||||
(format-prompt "Search for \"%s\" in files matching wildcard"
|
(format-prompt "Search for \"%s\" in files matching wildcard"
|
||||||
default regexp)
|
default regexp)
|
||||||
#'read-file-name-internal
|
(completion-table-merge
|
||||||
nil nil nil 'grep-files-history
|
(lambda (_string _pred _action) defaults)
|
||||||
(delete-dups
|
#'read-file-name-internal)
|
||||||
(delq nil
|
nil nil nil 'grep-files-history defaults)))
|
||||||
(append (list default default-alias default-extension)
|
|
||||||
(mapcar #'car grep-files-aliases)))))))
|
|
||||||
(and files
|
(and files
|
||||||
(or (cdr (assoc files grep-files-aliases))
|
(or (cdr (assoc files grep-files-aliases))
|
||||||
files))))
|
files))))
|
||||||
|
Loading…
Reference in New Issue
Block a user