emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master eadf4cf: Move part of the fix from project to xref


From: Dmitry Gutov
Subject: master eadf4cf: Move part of the fix from project to xref
Date: Thu, 22 Apr 2021 10:40:36 -0400 (EDT)

branch: master
commit eadf4cff7cff116d73f007dcfb1d636e9938df51
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    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).
---
 lisp/progmodes/project.el | 6 +-----
 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 1d0d1bc..1023b75 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -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))
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 3d2f21a..5d99915 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]