[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#23590: 25.0.94; Errors in default lgrep command
From: |
Alex |
Subject: |
bug#23590: 25.0.94; Errors in default lgrep command |
Date: |
Sat, 23 Jul 2016 16:12:55 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Sat, 23 Jul 2016 21:00:37 +0300
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org
>>
>> > Grep exited abnormally with code 2 at ...
>>
>> Because of this:
>>
>> > grep: ..?*: No such file or directory
>
> Actually, I see that "Is a directory" also caused exit code of 2. So
> I guess patches are welcome to add --directory=skip to the Grep
> command when a preliminary test reveals that Grep supports it.
Is the following patch acceptable?
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index f04a722..c696f75 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -573,10 +573,14 @@ This function is called from `compilation-filter-hook'."
grep-template grep-find-template)
(let ((grep-options
(concat (if grep-use-null-device "-n" "-nH")
- (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
bug#23590: 25.0.94; Errors in default lgrep command, Alex, 2016/07/23
bug#23590: 25.0.94; Errors in default lgrep command, Alex, 2016/07/23