summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/progmodes/grep.el10
2 files changed, 10 insertions, 5 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 63a740cf64c..e1f9382228e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -545,6 +545,11 @@ grep emits SGR ANSI escape sequences to color its output. The new variable
markers in order to provide highlighting in the source buffer. The variable
can be customized to accommodate other grep-like tools.
+---
+*** The 'lgrep' command now ignores directories.
+On systems where the grep command supports it, directories will be
+skipped.
+
** Help
+++
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6bc187028fb..f028a4279d1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -704,11 +704,6 @@ The value depends on `grep-command', `grep-template',
(concat (if grep-use-null-device "-n" "-nH")
(if grep-use-null-filename-separator " --null")
(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"))))
@@ -1126,6 +1121,11 @@ command before it's run."
grep-find-ignored-files
" --exclude=")))))
(when command
+ (when (grep-probe grep-program
+ `(nil nil nil "--directories=skip" "foo"
+ ,null-device)
+ nil 1)
+ (setq command (concat command " --directories=skip")))
(if confirm
(setq command
(read-from-minibuffer "Confirm: "