all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alex <agrambot@gmail.com>
Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org
Subject: bug#23590: 25.0.94; Errors in default lgrep command
Date: Fri, 04 Sep 2020 16:09:52 +0200	[thread overview]
Message-ID: <87r1rh8wgf.fsf@gnus.org> (raw)
In-Reply-To: <87twfg0zrs.fsf@gmail.com> (Alex's message of "Sat, 23 Jul 2016 16:12:55 -0600")

Alex <agrambot@gmail.com> writes:

>> 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?

There was discussion here before the patch was posted, but then no
follow-up.  I've respun the patch for Emacs 28 -- does anybody have any
comments?

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index c71a90344f..17f0422ac7 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -696,10 +696,15 @@ grep-compute-defaults
       (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


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-09-04 14:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21  0:11 bug#23590: 25.0.94; Errors in default lgrep command Alex
2016-07-23  2:16 ` John Mastro
2016-07-23  7:45   ` Eli Zaretskii
2016-07-23 16:57     ` John Mastro
2016-07-23 17:15       ` Eli Zaretskii
2016-07-23 17:23         ` John Mastro
2016-07-23 17:58           ` Eli Zaretskii
2016-07-23 19:52             ` Glenn Morris
2016-07-23 17:28     ` Alex
2016-07-23 18:00       ` Eli Zaretskii
2016-07-23 18:18         ` Eli Zaretskii
2016-07-23 22:12           ` Alex
2020-09-04 14:09             ` Lars Ingebrigtsen [this message]
2020-10-07  3:41               ` Lars Ingebrigtsen
2020-10-07  8:17                 ` Eli Zaretskii
2020-10-09  4:15                   ` Lars Ingebrigtsen
2020-10-13 20:09                     ` Juri Linkov
2020-10-14  4:10                       ` Lars Ingebrigtsen
2016-07-23 17:11   ` Alex

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1rh8wgf.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=23590@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    --cc=john.b.mastro@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.