Subject: bug#6674: PATCH: fix assignment of grep-find-use-xargs on Windows

From: Óscar Fuentes <[email-masked]>
Date: Wed, 21 Jul 2010 01:18:38 +0200

rgrep is broken on Windows. Although it is obvious that a general fix
for the shell issue is the most correct resolution for this bug, I
propose to apply the patch below and revert it once cmdproxy.c is
enhanced for dealing with the problem.

Otherwise, a workaround is to add

(setq grep-find-use-xargs 'exec)

to the user's .emacs file.

2010-07-21  Óscar Fuentes  <[email-masked]>

	* progmodes/grep.el (grep-compute-defaults): always assign
        'exec to grep-find-use-xargs on Windows.

=== modified file 'lisp/progmodes/grep.el'
*** lisp/progmodes/grep.el	2010-01-31 21:47:47 +0000
--- lisp/progmodes/grep.el	2010-07-20 23:04:56 +0000
*************** Set up `compilation-exit-message-functio
*** 552,557 ****
--- 552,561 ----
  	(unless grep-find-use-xargs
  	  (setq grep-find-use-xargs
  		(cond
+ 		 ;; Windows' shell has problems with long commands and
+ 		 ;; pipes. See bug #6674.
+ 		 ((eq system-type 'windows-nt)
+ 		  'exec)
  		 ((and
  		   (grep-probe find-program `(nil nil nil ,null-device "-print0"))
  		   (grep-probe xargs-program `(nil nil nil "-0" "-e" "echo")))