summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAntero Mejr <antero@mailbox.org>2023-03-24 20:41:41 +0000
committerJim Porter <jporterbugs@gmail.com>2023-04-10 21:00:17 -0700
commitebac67129e86ce201d88debb1a8c9d6924215e84 (patch)
tree6842579c083d287c1375fd0a35cf84da7d0462a0 /lisp
parent0724e0aeb5be7c60cd76c6afc8e22ed47d9c85bd (diff)
downloademacs-ebac67129e86ce201d88debb1a8c9d6924215e84.tar.gz
eshell: Add 'rgrep' builtin
* lisp/eshell/em-unix.el (eshell/rgrep): New function. (eshell-unix-initialize): Add "rgrep" to 'eshell-complex-commands'. * etc/NEWS: Add NEWS entry for rgrep. * doc/misc/eshell.texi (Built-ins): Add documentation for rgrep.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/eshell/em-unix.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index d550910f4f0..a792493e071 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -145,9 +145,10 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine."
(add-hook 'pcomplete-try-first-hook
'eshell-complete-host-reference nil t))
(setq-local eshell-complex-commands
- (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate"
- "cat" "time" "cp" "mv" "make" "du" "diff")
- eshell-complex-commands)))
+ (append '("grep" "egrep" "fgrep" "agrep" "rgrep"
+ "glimpse" "locate" "cat" "time" "cp" "mv"
+ "make" "du" "diff")
+ eshell-complex-commands)))
(defalias 'eshell/date 'current-time-string)
(defalias 'eshell/basename 'file-name-nondirectory)
@@ -773,6 +774,10 @@ external command."
"Use Emacs grep facility instead of calling external agrep."
(eshell-grep "agrep" args))
+(defun eshell/rgrep (&rest args)
+ "Use Emacs grep facility instead of calling external rgrep."
+ (eshell-grep "grep" (append '("-rH") args) t))
+
(defun eshell/glimpse (&rest args)
"Use Emacs grep facility instead of calling external glimpse."
(let (null-device)