]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve quoting of directory names in project/xref
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 16 Apr 2021 00:52:44 +0000 (03:52 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 16 Apr 2021 00:52:44 +0000 (03:52 +0300)
* lisp/progmodes/project.el (project--files-in-directory):
Quote LOCALDIR a bit earlier, to affect
xref--find-ignores-arguments as well (bug#47799).

* lisp/progmodes/xref.el (xref-matches-in-directory):
Quote the dir passed to xref--rgrep-command.

lisp/progmodes/project.el
lisp/progmodes/xref.el

index 1edbe069a4c61d2ebb58db43118ceb3f84edd7bb..1023b75e6686ff1b5139fab89e9aa06cca530159 100644 (file)
@@ -296,12 +296,11 @@ to find the list of ignores for each directory."
          ;; Make sure ~/ etc. in local directory name is
          ;; expanded and not left for the shell command
          ;; to interpret.
-         (localdir (file-local-name (expand-file-name dir)))
+         (localdir (file-name-unquote (file-local-name (expand-file-name dir))))
          (command (format "%s %s %s -type f %s -print0"
                           find-program
                           ;; In case DIR is a symlink.
-                          (file-name-unquote
-                           (file-name-as-directory localdir))
+                          (file-name-as-directory localdir)
                           (xref--find-ignores-arguments ignores localdir)
                           (if files
                               (concat (shell-quote-argument "(")
index cada1f110929b63fd9bf3f5d5c6904d161d42d77..3d2f21ab52fd29da2fa7fde3437e61fb20545613 100644 (file)
@@ -1416,7 +1416,8 @@ IGNORES is a list of glob patterns for files to ignore."
        (command (xref--rgrep-command (xref--regexp-to-extended regexp)
                                      files
                                      (file-name-as-directory
-                                      (file-local-name (expand-file-name dir)))
+                                      (file-name-unquote
+                                       (file-local-name (expand-file-name dir))))
                                      ignores))
        (def default-directory)
        (buf (get-buffer-create " *xref-grep*"))