mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 16:51:06 -07:00
Handle project--files-in-directory finding no files better
* lisp/progmodes/project.el (project--find-regexp-in-files): Signal user-error when passed an empty list of files. * lisp/progmodes/xref.el (xref-matches-in-files): Make sure FILES is not empty.
This commit is contained in:
parent
650a664ccd
commit
ac3da1dd96
2 changed files with 3 additions and 0 deletions
|
|
@ -480,6 +480,8 @@ pattern to search for."
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(defun project--find-regexp-in-files (regexp files)
|
(defun project--find-regexp-in-files (regexp files)
|
||||||
|
(unless files
|
||||||
|
(user-error "Empty file list"))
|
||||||
(let ((xrefs (xref-matches-in-files regexp files)))
|
(let ((xrefs (xref-matches-in-files regexp files)))
|
||||||
(unless xrefs
|
(unless xrefs
|
||||||
(user-error "No matches for: %s" regexp))
|
(user-error "No matches for: %s" regexp))
|
||||||
|
|
|
||||||
|
|
@ -1232,6 +1232,7 @@ IGNORES is a list of glob patterns for files to ignore."
|
||||||
"Find all matches for REGEXP in FILES.
|
"Find all matches for REGEXP in FILES.
|
||||||
Return a list of xref values.
|
Return a list of xref values.
|
||||||
FILES must be a list of absolute file names."
|
FILES must be a list of absolute file names."
|
||||||
|
(cl-assert (consp files))
|
||||||
(pcase-let*
|
(pcase-let*
|
||||||
((output (get-buffer-create " *project grep output*"))
|
((output (get-buffer-create " *project grep output*"))
|
||||||
(`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist))
|
(`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue