diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 5f9a3fa352..21f075041c 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -119,12 +119,15 @@ semantic-symref-grep-use-template ;; it to the user. By contrast, here we don't show ;; the output, and the SGR escapes get in the way ;; of parsing the output. - (replace-regexp-in-string "--color=always" "" - grep-find-template t t) + (replace-regexp-in-string + "" "-H " + (replace-regexp-in-string "--color=always" "" + grep-find-template t t) + t t) grep-find-template) pattern filepattern - rootdir))) + (directory-file-name rootdir)))) cmd)) (defcustom semantic-symref-grep-shell shell-file-name diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d417382c0d..04546d1e4d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -289,9 +289,9 @@ project--files-in-directory ;; expanded and not left for the shell command ;; to interpret. (localdir (file-local-name (expand-file-name dir))) - (command (format "%s %s %s -type f %s -print0" + (command (format "%s -H %s %s -type f %s -print0" find-program - localdir + (directory-file-name localdir) (xref--find-ignores-arguments ignores localdir) (if files (concat (shell-quote-argument "(") diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index d2b5acd555..13fc2f09c7 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1374,7 +1374,8 @@ xref-matches-in-directory ;; do that reliably enough, without creating false negatives? (command (xref--rgrep-command (xref--regexp-to-extended regexp) files - (file-local-name (expand-file-name dir)) + (directory-file-name + (file-local-name (expand-file-name dir))) ignores)) (def default-directory) (buf (get-buffer-create " *xref-grep*")) @@ -1543,7 +1544,10 @@ xref--rgrep-command ;; `shell-quote-argument' quotes the tilde as well. (cl-assert (not (string-match-p "\\`~" dir))) (grep-expand-template - grep-find-template + (replace-regexp-in-string + "" "-H " + grep-find-template + t t) regexp (concat (shell-quote-argument "(") " " find-name-arg " "