summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAlex Gramiak <agrambot@gmail.com>2020-10-07 05:41:23 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-10-07 05:41:23 +0200
commit0ab67a65f58e767f73a55f28e37b1a80bfc36682 (patch)
treef8b9bcea666280a96563116568771888bf067fea /lisp
parentc842bd993f343d5dce1fe51fd72cb9aa345eef99 (diff)
downloademacs-0ab67a65f58e767f73a55f28e37b1a80bfc36682.tar.gz
emacs-0ab67a65f58e767f73a55f28e37b1a80bfc36682.tar.bz2
emacs-0ab67a65f58e767f73a55f28e37b1a80bfc36682.zip
Default the grep commands to skip directories
* lisp/progmodes/grep.el (grep-compute-defaults): Skip directories (bug#23590).
Diffstat (limited to 'lisp')
-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