emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0ab67a6: Default the grep commands to skip directories


From: Lars Ingebrigtsen
Subject: master 0ab67a6: Default the grep commands to skip directories
Date: Tue, 6 Oct 2020 23:41:32 -0400 (EDT)

branch: master
commit 0ab67a65f58e767f73a55f28e37b1a80bfc36682
Author: Alex Gramiak <agrambot@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Default the grep commands to skip directories
    
    * lisp/progmodes/grep.el (grep-compute-defaults): Skip directories
    (bug#23590).
---
 lisp/progmodes/grep.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 279eb4d..6bc1870 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]