diff options
| author | Dmitry Gutov | 2021-04-22 03:29:09 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2021-04-22 17:40:30 +0300 |
| commit | eadf4cff7cff116d73f007dcfb1d636e9938df51 (patch) | |
| tree | ec28f64c10ef8a73ce59451c5fca1123ec4eaf6a | |
| parent | aaf6b6bf80805d18180e1c16350e9473716f5915 (diff) | |
| download | emacs-eadf4cff7cff116d73f007dcfb1d636e9938df51.tar.gz emacs-eadf4cff7cff116d73f007dcfb1d636e9938df51.zip | |
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).
| -rw-r--r-- | lisp/progmodes/project.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1d0d1bc58a4..1023b75e668 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -787,11 +787,7 @@ pattern to search for." | |||
| 787 | (defun project--find-regexp-in-files (regexp files) | 787 | (defun project--find-regexp-in-files (regexp files) |
| 788 | (unless files | 788 | (unless files |
| 789 | (user-error "Empty file list")) | 789 | (user-error "Empty file list")) |
| 790 | (let ((xrefs (xref-matches-in-files | 790 | (let ((xrefs (xref-matches-in-files regexp files))) |
| 791 | regexp | ||
| 792 | ;; FIXME: `xref-matches-in-files' should work with | ||
| 793 | ;; quoted filenames. | ||
| 794 | (mapcar #'file-name-unquote files)))) | ||
| 795 | (unless xrefs | 791 | (unless xrefs |
| 796 | (user-error "No matches for: %s" regexp)) | 792 | (user-error "No matches for: %s" regexp)) |
| 797 | xrefs)) | 793 | xrefs)) |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3d2f21ab52f..5d99915347b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -1534,6 +1534,8 @@ FILES must be a list of absolute file names." | |||
| 1534 | #'tramp-file-local-name | 1534 | #'tramp-file-local-name |
| 1535 | #'file-local-name) | 1535 | #'file-local-name) |
| 1536 | files))) | 1536 | files))) |
| 1537 | (when (file-name-quoted-p (car files)) | ||
| 1538 | (setq files (mapcar #'file-name-unquote files))) | ||
| 1537 | (with-current-buffer output | 1539 | (with-current-buffer output |
| 1538 | (erase-buffer) | 1540 | (erase-buffer) |
| 1539 | (with-temp-buffer | 1541 | (with-temp-buffer |