GNU bug report logs - #23590
25.0.94; Errors in default lgrep command

Previous Next

Package: emacs;

Reported by: Alex <agrambot <at> gmail.com>

Date: Sat, 21 May 2016 00:12:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.0.94

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alex <agrambot <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: john.b.mastro <at> gmail.com, 23590 <at> debbugs.gnu.org
Subject: bug#23590: 25.0.94; Errors in default lgrep command
Date: Sat, 23 Jul 2016 16:12:55 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sat, 23 Jul 2016 21:00:37 +0300
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> Cc: john.b.mastro <at> gmail.com, 23590 <at> 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




This bug report was last modified 4 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.