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.
This commit is contained in:
Antero Mejr 2023-03-24 20:41:41 +00:00 committed by Jim Porter
parent 0724e0aeb5
commit ebac67129e
3 changed files with 15 additions and 3 deletions

View file

@ -602,6 +602,8 @@ disabled by default.
@cmindex egrep
@itemx fgrep
@cmindex fgrep
@itemx rgrep
@cmindex rgrep
@itemx glimpse
@cmindex glimpse
The @command{grep} commands are compatible with GNU @command{grep},

View file

@ -174,6 +174,11 @@ correctly unloads Eshell and all of its modules.
After manually editing 'eshell-aliases-file', you can use this command
to load the edited aliases.
+++
*** 'rgrep' is now a builtin command.
Running "rgrep" in Eshell now uses the Emacs grep facility instead of
calling external rgrep.
** Shell Mode
+++

View file

@ -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)