GNU bug report logs - #62426
[PATCH] eshell: Add 'rgrep' builtin.

Previous Next

Package: emacs;

Reported by: Antero Mejr <antero <at> mailbox.org>

Date: Fri, 24 Mar 2023 21:03:01 UTC

Severity: normal

Tags: patch

Done: Antero Mejr <antero <at> mailbox.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Antero Mejr <antero <at> mailbox.org>, 62426 <at> debbugs.gnu.org
Subject: bug#62426: [PATCH] eshell: Add 'rgrep' builtin.
Date: Sat, 25 Mar 2023 10:22:07 -0700
Hello,

On Fri 24 Mar 2023 at 05:04PM -07, Jim Porter wrote:

> On 3/24/2023 2:02 PM, Antero Mejr via Bug reports for GNU Emacs, the Swiss
> army knife of text editors wrote:
>> 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.
>
> Thanks, I think it would make sense to add an rgrep built-in to
> Eshell. However, I'm not sure if this is the best way for it to
> work. Personally, I'd have expected this to use the 'rgrep' function in Emacs
> Lisp (which uses find + grep to do its job). That's a bit different from
> /usr/bin/rgrep, but I find it a lot more useful since it ignores
> "uninteresting" files by default. For example, 'M-x rgrep' in a Git repo
> ignores the .git/ subdir, but /usr/bin/rgrep includes that subdir. Hence, I'd
> almost always prefer Emacs' version of rgrep.
>
> That said, it might be a bit strange for Eshell's rgrep to work this way, when
> Eshell's agrep/egrep/fgrep work like the external versions. This seems like a
> tricky case...

Tricky indeed.  Here is an attempt:

Normally with M-x rgrep one benefits from how Emacs prompts you
separately for the parameters to the function, right?  In particular,
you get completion for the second and third parameters.  Given that,
you're unlikely to want to type 'rgrep foo bar baz' into Eshell, and not
benefit from that completion, when you could just type M-x rgrep in the
same buffer, and benefit from it.

Given this, I suggest rgrep in Eshell should be /usr/bin/rgrep.

-- 
Sean Whitton




This bug report was last modified 1 year and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.