aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrendan O'Dea2022-08-17 13:20:15 +0200
committerLars Ingebrigtsen2022-08-17 13:20:15 +0200
commitdeddd56e3521aa2544575a8b10ffb4c99ee3be74 (patch)
tree4ed4db0a26243a9c23136f1a20b3da61092d180d
parent4915ca5dd4245a909c046e6691e8d4a1919890c8 (diff)
downloademacs-deddd56e3521aa2544575a8b10ffb4c99ee3be74.tar.gz
emacs-deddd56e3521aa2544575a8b10ffb4c99ee3be74.zip
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.
-rw-r--r--lisp/eshell/em-unix.el13
1 files changed, 4 insertions, 9 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 68276b22d95..40b83010f94 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -755,26 +755,21 @@ external command."
755 (eshell-stringify-list 755 (eshell-stringify-list
756 (flatten-tree args))) 756 (flatten-tree args)))
757 " ")) 757 " "))
758 (cmd (format "%s -nH %s" 758 (cmd (format "%s -n %s" command args))
759 (pcase command
760 ("egrep" "grep -E")
761 ("fgrep" "grep -F")
762 (x x))
763 args))
764 compilation-scroll-output) 759 compilation-scroll-output)
765 (grep cmd))))) 760 (grep cmd)))))
766 761
767(defun eshell/grep (&rest args) 762(defun eshell/grep (&rest args)
768 "Use Emacs grep facility instead of calling external grep." 763 "Use Emacs grep facility instead of calling external grep."
769 (eshell-grep "grep" args t)) 764 (eshell-grep "grep" (append '("-H") args) t))
770 765
771(defun eshell/egrep (&rest args) 766(defun eshell/egrep (&rest args)
772 "Use Emacs grep facility instead of calling external grep -E." 767 "Use Emacs grep facility instead of calling external grep -E."
773 (eshell-grep "egrep" args t)) 768 (eshell-grep "grep" (append '("-EH") args) t))
774 769
775(defun eshell/fgrep (&rest args) 770(defun eshell/fgrep (&rest args)
776 "Use Emacs grep facility instead of calling external grep -F." 771 "Use Emacs grep facility instead of calling external grep -F."
777 (eshell-grep "fgrep" args t)) 772 (eshell-grep "grep" (append '("-FH") args) t))
778 773
779(defun eshell/agrep (&rest args) 774(defun eshell/agrep (&rest args)
780 "Use Emacs grep facility instead of calling external agrep." 775 "Use Emacs grep facility instead of calling external agrep."