summaryrefslogtreecommitdiff
path: root/lisp/progmodes/grep.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r--lisp/progmodes/grep.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 279eb4d54b1..6bc187028fb 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -703,10 +703,15 @@ The value depends on `grep-command', `grep-template',
(let ((grep-options
(concat (if grep-use-null-device "-n" "-nH")
(if grep-use-null-filename-separator " --null")
- (if (grep-probe grep-program
- `(nil nil nil "-e" "foo" ,null-device)
- nil 1)
- " -e"))))
+ (when (grep-probe grep-program
+ `(nil nil nil "--directories=skip" "foo"
+ ,null-device)
+ nil 1)
+ " --directories=skip")
+ (when (grep-probe grep-program
+ `(nil nil nil "-e" "foo" ,null-device)
+ nil 1)
+ " -e"))))
(unless grep-command
(setq grep-command
(format "%s %s %s " grep-program