diff options
| author | Antero Mejr | 2023-03-24 20:41:41 +0000 |
|---|---|---|
| committer | Jim Porter | 2023-04-10 21:00:17 -0700 |
| commit | ebac67129e86ce201d88debb1a8c9d6924215e84 (patch) | |
| tree | 6842579c083d287c1375fd0a35cf84da7d0462a0 | |
| parent | 0724e0aeb5be7c60cd76c6afc8e22ed47d9c85bd (diff) | |
| download | emacs-ebac67129e86ce201d88debb1a8c9d6924215e84.tar.gz emacs-ebac67129e86ce201d88debb1a8c9d6924215e84.zip | |
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.
| -rw-r--r-- | doc/misc/eshell.texi | 2 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | 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. | |||
| 602 | @cmindex egrep | 602 | @cmindex egrep |
| 603 | @itemx fgrep | 603 | @itemx fgrep |
| 604 | @cmindex fgrep | 604 | @cmindex fgrep |
| 605 | @itemx rgrep | ||
| 606 | @cmindex rgrep | ||
| 605 | @itemx glimpse | 607 | @itemx glimpse |
| 606 | @cmindex glimpse | 608 | @cmindex glimpse |
| 607 | The @command{grep} commands are compatible with GNU @command{grep}, | 609 | The @command{grep} commands are compatible with GNU @command{grep}, |
| @@ -174,6 +174,11 @@ correctly unloads Eshell and all of its modules. | |||
| 174 | After manually editing 'eshell-aliases-file', you can use this command | 174 | After manually editing 'eshell-aliases-file', you can use this command |
| 175 | to load the edited aliases. | 175 | to load the edited aliases. |
| 176 | 176 | ||
| 177 | +++ | ||
| 178 | *** 'rgrep' is now a builtin command. | ||
| 179 | Running "rgrep" in Eshell now uses the Emacs grep facility instead of | ||
| 180 | calling external rgrep. | ||
| 181 | |||
| 177 | ** Shell Mode | 182 | ** Shell Mode |
| 178 | 183 | ||
| 179 | +++ | 184 | +++ |
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." | |||
| 145 | (add-hook 'pcomplete-try-first-hook | 145 | (add-hook 'pcomplete-try-first-hook |
| 146 | 'eshell-complete-host-reference nil t)) | 146 | 'eshell-complete-host-reference nil t)) |
| 147 | (setq-local eshell-complex-commands | 147 | (setq-local eshell-complex-commands |
| 148 | (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate" | 148 | (append '("grep" "egrep" "fgrep" "agrep" "rgrep" |
| 149 | "cat" "time" "cp" "mv" "make" "du" "diff") | 149 | "glimpse" "locate" "cat" "time" "cp" "mv" |
| 150 | eshell-complex-commands))) | 150 | "make" "du" "diff") |
| 151 | eshell-complex-commands))) | ||
| 151 | 152 | ||
| 152 | (defalias 'eshell/date 'current-time-string) | 153 | (defalias 'eshell/date 'current-time-string) |
| 153 | (defalias 'eshell/basename 'file-name-nondirectory) | 154 | (defalias 'eshell/basename 'file-name-nondirectory) |
| @@ -773,6 +774,10 @@ external command." | |||
| 773 | "Use Emacs grep facility instead of calling external agrep." | 774 | "Use Emacs grep facility instead of calling external agrep." |
| 774 | (eshell-grep "agrep" args)) | 775 | (eshell-grep "agrep" args)) |
| 775 | 776 | ||
| 777 | (defun eshell/rgrep (&rest args) | ||
| 778 | "Use Emacs grep facility instead of calling external rgrep." | ||
| 779 | (eshell-grep "grep" (append '("-rH") args) t)) | ||
| 780 | |||
| 776 | (defun eshell/glimpse (&rest args) | 781 | (defun eshell/glimpse (&rest args) |
| 777 | "Use Emacs grep facility instead of calling external glimpse." | 782 | "Use Emacs grep facility instead of calling external glimpse." |
| 778 | (let (null-device) | 783 | (let (null-device) |