summaryrefslogtreecommitdiff
path: root/lisp/progmodes/grep.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-01-15 12:03:38 -0800
committerGlenn Morris <rgm@gnu.org>2011-01-15 12:03:38 -0800
commit362b9d483c714a8fd87966ddbd8686850f870e34 (patch)
treee37a94fe030c9361fa28b4f3f5c8910cc7ab8448 /lisp/progmodes/grep.el
parentdab7376027ea499962b2916652c6f30b40eac6d9 (diff)
parent0ad254447b7542284a2eb3c63b0732edb9409af7 (diff)
downloademacs-362b9d483c714a8fd87966ddbd8686850f870e34.tar.gz
Merge from emacs-23 branch.
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r--lisp/progmodes/grep.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 8e36d3f5c6d..b327cf6b87d 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -565,7 +565,10 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(unless grep-find-command
(setq grep-find-command
(cond ((eq grep-find-use-xargs 'gnu)
- (format "%s . -type f -print0 | %s -0 -e %s"
+ ;; Windows shells need the program file name
+ ;; after the pipe symbol be quoted if they use
+ ;; forward slashes as directory separators.
+ (format "%s . -type f -print0 | \"%s\" -0 -e %s"
find-program xargs-program grep-command))
((eq grep-find-use-xargs 'exec)
(let ((cmd0 (format "%s . -type f -exec %s"
@@ -576,21 +579,21 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(shell-quote-argument ";"))
(1+ (length cmd0)))))
(t
- (format "%s . -type f -print | %s %s"
+ (format "%s . -type f -print | \"%s\" %s"
find-program xargs-program grep-command)))))
(unless grep-find-template
(setq grep-find-template
(let ((gcmd (format "%s <C> %s <R>"
grep-program grep-options)))
(cond ((eq grep-find-use-xargs 'gnu)
- (format "%s . <X> -type f <F> -print0 | %s -0 -e %s"
+ (format "%s . <X> -type f <F> -print0 | \"%s\" -0 -e %s"
find-program xargs-program gcmd))
((eq grep-find-use-xargs 'exec)
(format "%s . <X> -type f <F> -exec %s {} %s %s"
find-program gcmd null-device
(shell-quote-argument ";")))
(t
- (format "%s . <X> -type f <F> -print | %s %s"
+ (format "%s . <X> -type f <F> -print | \"%s\" %s"
find-program xargs-program gcmd))))))))
(when (eq grep-highlight-matches 'auto-detect)
(setq grep-highlight-matches