Here's an alternative patch which does the same thing: From 788e97faa859798b67ec7b0b7facd843fae85c5f Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Wed, 4 May 2016 17:37:42 -0400 Subject: [PATCH] Shell escape arguments for find cmd used by xref * lisp/progmodes/xref.el (xref--rgrep-command): When the dir has characters like spaces (e.g. /tmp/some dir/), those need to be escaped before passing it as an argument to the shell command like `find'. The escaping is done using `shell-quote-argument' (bug#23453). --- lisp/progmodes/xref.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 62cef23..1764e88 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -921,8 +921,8 @@ xref--rgrep-command (concat " -o " find-name-arg " ")) " " (shell-quote-argument ")")) - dir - (xref--find-ignores-arguments ignores dir))) + (shell-quote-argument dir) + (xref--find-ignores-arguments ignores (shell-quote-argument dir)))) (defun xref--find-ignores-arguments (ignores dir) "Convert IGNORES and DIR to a list of arguments for 'find'. -- 2.6.0.rc0.24.gec371ff -- -- Kaushal Modi