1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-11 01:11:31 -07:00

Better project-find-file error in empty project

* lisp/progmodes/project.el (project--read-file-name): Signal a
user-error and don't call project-read-file-name-function if the
file name collection is empty, since the default options for
project-read-file-name-function expect a cons (bug#80509).
(project-find-file-in): Avoid redundant consing for
vc-directory-exclusion-list in default case of include-all=nil.
This commit is contained in:
Basil L. Contovounesios 2026-02-28 11:01:44 +01:00
parent 31b106c1e2
commit ada12edeb7

View file

@ -1372,6 +1372,8 @@ by the user at will."
Depending on `project-file-history-behavior', entries are made
project-relative where possible."
(unless all-files
(user-error "Empty file list"))
(let ((file
(cl-letf ((history-add-new-input nil)
((symbol-value hist)
@ -1400,7 +1402,8 @@ directories listed in `vc-directory-exclusion-list'."
(let* ((vc-dirs-ignores (mapcar
(lambda (dir)
(concat dir "/"))
vc-directory-exclusion-list))
(and include-all
vc-directory-exclusion-list)))
(all-files
(if include-all
(mapcan