1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Improve quoting of directory names in project/xref

* 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.
This commit is contained in:
Dmitry Gutov 2021-04-16 03:52:44 +03:00
parent 4180429d5d
commit f955df1788
2 changed files with 4 additions and 4 deletions

View 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 "(")

View 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*"))