diff options
| author | Basil L. Contovounesios | 2026-02-28 11:01:44 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2026-02-28 16:58:45 +0100 |
| commit | ada12edeb7f3018a06d5e9d9ee7aff35bb036b1d (patch) | |
| tree | 7b3f21ef92fd7760a97893e3964c1e25171a0860 | |
| parent | 31b106c1e2ed78bca74f088083e9400c5618b861 (diff) | |
| download | emacs-ada12edeb7f3018a06d5e9d9ee7aff35bb036b1d.tar.gz emacs-ada12edeb7f3018a06d5e9d9ee7aff35bb036b1d.zip | |
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.
| -rw-r--r-- | lisp/progmodes/project.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 98d0d960684..b920c187f74 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -1372,6 +1372,8 @@ by the user at will." | |||
| 1372 | 1372 | ||
| 1373 | Depending on `project-file-history-behavior', entries are made | 1373 | Depending on `project-file-history-behavior', entries are made |
| 1374 | project-relative where possible." | 1374 | project-relative where possible." |
| 1375 | (unless all-files | ||
| 1376 | (user-error "Empty file list")) | ||
| 1375 | (let ((file | 1377 | (let ((file |
| 1376 | (cl-letf ((history-add-new-input nil) | 1378 | (cl-letf ((history-add-new-input nil) |
| 1377 | ((symbol-value hist) | 1379 | ((symbol-value hist) |
| @@ -1400,7 +1402,8 @@ directories listed in `vc-directory-exclusion-list'." | |||
| 1400 | (let* ((vc-dirs-ignores (mapcar | 1402 | (let* ((vc-dirs-ignores (mapcar |
| 1401 | (lambda (dir) | 1403 | (lambda (dir) |
| 1402 | (concat dir "/")) | 1404 | (concat dir "/")) |
| 1403 | vc-directory-exclusion-list)) | 1405 | (and include-all |
| 1406 | vc-directory-exclusion-list))) | ||
| 1404 | (all-files | 1407 | (all-files |
| 1405 | (if include-all | 1408 | (if include-all |
| 1406 | (mapcan | 1409 | (mapcan |