all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#62426: [PATCH] eshell: Add 'rgrep' builtin.
@ 2023-03-24 21:02 Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-03-25  0:04 ` Jim Porter
  2023-06-03  1:41 ` bug#62426: (no subject) Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 10+ messages in thread
From: Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-03-24 21:02 UTC (permalink / raw)
  To: 62426

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]


eshell has builtins for agrep/egrep/fgrep that use the Emacs grep
feature, but rgrep is not included so it behaves differently. This patch
adds the rgrep builtin.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-eshell-Add-rgrep-builtin.patch --]
[-- Type: text/x-patch, Size: 2429 bytes --]

From 7a56cea33b5f6d0025003405b83da028e93576a8 Mon Sep 17 00:00:00 2001
From: Antero Mejr <antero@mailbox.org>
Date: Fri, 24 Mar 2023 20:41:41 +0000
Subject: [PATCH] eshell: Add 'rgrep' builtin.

* lisp/eshell/em-unix.el (eshell/rgrep): New procedure.
(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 | 8 ++++++--
 3 files changed, 13 insertions(+), 2 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 @@ Built-ins
 @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 2a87bf08406..240ecb37f62 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 an builtin command.
+Running "rgrep" is eshell now uses the Emacs grep facility instead of
+calling external rgrep.
+
 ** Prog Mode
 
 +++
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index d550910f4f0..0681ba11691 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -145,8 +145,8 @@ eshell-unix-initialize
     (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")
+	(append '("grep" "egrep" "fgrep" "agrep" "rgrep" "glimpse"
+		  "locate" "cat" "time" "cp" "mv" "make" "du" "diff")
 		eshell-complex-commands)))
 
 (defalias 'eshell/date     'current-time-string)
@@ -773,6 +773,10 @@ eshell/agrep
   "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)
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-06-03  1:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 21:02 bug#62426: [PATCH] eshell: Add 'rgrep' builtin Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-25  0:04 ` Jim Porter
2023-03-25 17:22   ` Sean Whitton
2023-03-25 19:07     ` Jim Porter
2023-03-30 21:19       ` Sean Whitton
2023-03-31  0:14         ` Jim Porter
2023-04-09  1:55     ` Jim Porter
2023-04-11  2:12       ` Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-11  4:01         ` Jim Porter
2023-06-03  1:41 ` bug#62426: (no subject) Antero Mejr via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.