Move part of the fix from project to xref

* lisp/progmodes/project.el (project--find-regexp-in-files):
Don't unquote file names here.

* lisp/progmodes/xref.el (xref-matches-in-files): Do it here.
And only if the first element in the list is quoted (bug#47799).
This commit is contained in:
Dmitry Gutov 2021-04-22 03:29:09 +03:00
parent aaf6b6bf80
commit eadf4cff7c
2 changed files with 3 additions and 5 deletions

View file

@ -787,11 +787,7 @@ pattern to search for."
(defun project--find-regexp-in-files (regexp files)
(unless files
(user-error "Empty file list"))
(let ((xrefs (xref-matches-in-files
regexp
;; FIXME: `xref-matches-in-files' should work with
;; quoted filenames.
(mapcar #'file-name-unquote files))))
(let ((xrefs (xref-matches-in-files regexp files)))
(unless xrefs
(user-error "No matches for: %s" regexp))
xrefs))

View file

@ -1534,6 +1534,8 @@ FILES must be a list of absolute file names."
#'tramp-file-local-name
#'file-local-name)
files)))
(when (file-name-quoted-p (car files))
(setq files (mapcar #'file-name-unquote files)))
(with-current-buffer output
(erase-buffer)
(with-temp-buffer