diff options
author | Philipp Stephani <phst@google.com> | 2021-04-18 21:47:53 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2021-04-18 21:59:25 +0200 |
commit | 6ebc6e12cfa8909655e3c0e722d3c5727ea418d8 (patch) | |
tree | 3929606b4fbbc40db68abafeb30d49da9a784950 /lisp/progmodes/project.el | |
parent | 55b22bff6d5fc573c2d1e5b05faa12bed5ee4156 (diff) | |
download | emacs-6ebc6e12cfa8909655e3c0e722d3c5727ea418d8.tar.gz emacs-6ebc6e12cfa8909655e3c0e722d3c5727ea418d8.tar.bz2 emacs-6ebc6e12cfa8909655e3c0e722d3c5727ea418d8.zip |
Add quoted filename support to 'project-find-regexp' (Bug#47799).
This is only a band-aid; it would be better to fix xref.el to work
with quoted filenames as well.
* lisp/progmodes/project.el (project--find-regexp-in-files): Unquote
filenames before passing them to 'xref-matches-in-files'.
* test/lisp/progmodes/project-tests.el (project/quoted-directory):
Also test 'project-find-regexp'.
Diffstat (limited to 'lisp/progmodes/project.el')
-rw-r--r-- | lisp/progmodes/project.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1023b75e668..1d0d1bc58a4 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -787,7 +787,11 @@ 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 files))) + (let ((xrefs (xref-matches-in-files + regexp + ;; FIXME: `xref-matches-in-files' should work with + ;; quoted filenames. + (mapcar #'file-name-unquote files)))) (unless xrefs (user-error "No matches for: %s" regexp)) xrefs)) |