aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/project.el3
-rw-r--r--lisp/progmodes/xref.el5
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 9c8a88c80fc..a51c383b93b 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -172,7 +172,8 @@ to find the list of ignores for each directory."
172 (let ((command 172 (let ((command
173 (format "%s %s %s -type f -print0" 173 (format "%s %s %s -type f -print0"
174 find-program 174 find-program
175 dir 175 (shell-quote-argument
176 (expand-file-name dir))
176 (xref--find-ignores-arguments 177 (xref--find-ignores-arguments
177 (project-ignores project dir) 178 (project-ignores project dir)
178 (expand-file-name dir))))) 179 (expand-file-name dir)))))
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 17bfdb69f8f..1c28390258c 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -941,6 +941,8 @@ IGNORES is a list of glob patterns."
941 (require 'find-dired) ; for `find-name-arg' 941 (require 'find-dired) ; for `find-name-arg'
942 (defvar grep-find-template) 942 (defvar grep-find-template)
943 (defvar find-name-arg) 943 (defvar find-name-arg)
944 ;; `shell-quote-argument' quotes the tilde as well.
945 (cl-assert (not (string-match-p "\\`~" dir)))
944 (grep-expand-template 946 (grep-expand-template
945 grep-find-template 947 grep-find-template
946 regexp 948 regexp
@@ -952,14 +954,13 @@ IGNORES is a list of glob patterns."
952 (concat " -o " find-name-arg " ")) 954 (concat " -o " find-name-arg " "))
953 " " 955 " "
954 (shell-quote-argument ")")) 956 (shell-quote-argument ")"))
955 dir 957 (shell-quote-argument dir)
956 (xref--find-ignores-arguments ignores dir))) 958 (xref--find-ignores-arguments ignores dir)))
957 959
958(defun xref--find-ignores-arguments (ignores dir) 960(defun xref--find-ignores-arguments (ignores dir)
959 "Convert IGNORES and DIR to a list of arguments for 'find'. 961 "Convert IGNORES and DIR to a list of arguments for 'find'.
960IGNORES is a list of glob patterns. DIR is an absolute 962IGNORES is a list of glob patterns. DIR is an absolute
961directory, used as the root of the ignore globs." 963directory, used as the root of the ignore globs."
962 ;; `shell-quote-argument' quotes the tilde as well.
963 (cl-assert (not (string-match-p "\\`~" dir))) 964 (cl-assert (not (string-match-p "\\`~" dir)))
964 (when ignores 965 (when ignores
965 (concat 966 (concat