emacs-diffs
[Top][All Lists]
Advanced

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

master deddd56e35: em-unix.el: only pass -H option to grep


From: Lars Ingebrigtsen
Subject: master deddd56e35: em-unix.el: only pass -H option to grep
Date: Wed, 17 Aug 2022 07:20:55 -0400 (EDT)

branch: master
commit deddd56e3521aa2544575a8b10ffb4c99ee3be74
Author: Brendan O'Dea <bod@debian.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    em-unix.el: only pass -H option to grep
    
    * lisp/eshell/em-unix.el (eshell-grep): Don't add -H, because that
    breaks agrep/glimpse etc (bug#57247).
    (eshell/grep, eshell/egrep, eshell/fgrep): Instead add it here.
---
 lisp/eshell/em-unix.el | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 68276b22d9..40b83010f9 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -755,26 +755,21 @@ external command."
                                      (eshell-stringify-list
                                       (flatten-tree args)))
                              " "))
-            (cmd (format "%s -nH %s"
-                         (pcase command
-                           ("egrep" "grep -E")
-                           ("fgrep" "grep -F")
-                           (x x))
-                         args))
+            (cmd (format "%s -n %s" command args))
             compilation-scroll-output)
        (grep cmd)))))
 
 (defun eshell/grep (&rest args)
   "Use Emacs grep facility instead of calling external grep."
-  (eshell-grep "grep" args t))
+  (eshell-grep "grep" (append '("-H") args) t))
 
 (defun eshell/egrep (&rest args)
   "Use Emacs grep facility instead of calling external grep -E."
-  (eshell-grep "egrep" args t))
+  (eshell-grep "grep" (append '("-EH") args) t))
 
 (defun eshell/fgrep (&rest args)
   "Use Emacs grep facility instead of calling external grep -F."
-  (eshell-grep "fgrep" args t))
+  (eshell-grep "grep" (append '("-FH") args) t))
 
 (defun eshell/agrep (&rest args)
   "Use Emacs grep facility instead of calling external agrep."



reply via email to

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