[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ebac67129e8: eshell: Add 'rgrep' builtin
From: |
Jim Porter |
Subject: |
master ebac67129e8: eshell: Add 'rgrep' builtin |
Date: |
Tue, 11 Apr 2023 00:00:29 -0400 (EDT) |
branch: master
commit ebac67129e86ce201d88debb1a8c9d6924215e84
Author: Antero Mejr <antero@mailbox.org>
Commit: Jim Porter <jporterbugs@gmail.com>
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.
---
doc/misc/eshell.texi | 2 ++
etc/NEWS | 5 +++++
lisp/eshell/em-unix.el | 11 ++++++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 1c33c04f647..4e2bddf42af 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -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},
diff --git a/etc/NEWS b/etc/NEWS
index c61a9ec3c5f..5e1fd76e99e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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
+++
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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master ebac67129e8: eshell: Add 'rgrep' builtin,
Jim Porter <=