unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Sean Whitton <spwhitton@spwhitton.name>
To: Jim Porter <jporterbugs@gmail.com>
Cc: Antero Mejr <antero@mailbox.org>, 62426@debbugs.gnu.org
Subject: bug#62426: [PATCH] eshell: Add 'rgrep' builtin.
Date: Thu, 30 Mar 2023 14:19:08 -0700	[thread overview]
Message-ID: <87o7oavsxf.fsf@melete.silentflame.com> (raw)
In-Reply-To: <314663e3-ff4e-814c-6ff7-6ab3376ef458@gmail.com> (Jim Porter's message of "Sat, 25 Mar 2023 12:07:37 -0700")

Hello,

On Sat 25 Mar 2023 at 12:07PM -07, Jim Porter wrote:

> Even without Pcomplete support, there's still a benefit to a command
> like this though: you could use Eshell to pipe the results of 'M-x
> rgrep' to some other command. Looking at the code for 'eshell-grep', I
> don't think it'd be terribly difficult to support this case.

Can you give a concrete use case?  If you're piping won't you typically
want to reuse your knowledge of traditional grep(1)?  If I'm piping then
I'm probably thinking in non-Emacs terms.

> Maybe there should be a defcustom for this ("use M-x rgrep" vs "use
> /usr/bin/rgrep")? Or maybe it should be easier to configure various
> Eshell commands so they open in a compilation buffer when appropriate?
> You can do this now with an alias, but the syntax is a bit tricky:
>
>   alias rgrep 'eshell-grep grep ${append (list "-rH") $*}'
>
> Something like this would be nicer:
>
>   alias rgrep 'to-compilation-buffer rgrep -rH $*'
>
> That would make it easier for users to define their own commands that
> work like this, which would (probably) be generally useful and provide
> a partial solution for this bug while we consider the available
> options. (My main goal with doing this now is so that we don't merge
> something and then change our minds later, disrupting users' habits.)

A command-specific defcustom doesn't seem ideal because we could end up
with very many such things.  Something like your compilation buffer idea
sounds good.

-- 
Sean Whitton





  reply	other threads:[~2023-03-30 21:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7oavsxf.fsf@melete.silentflame.com \
    --to=spwhitton@spwhitton.name \
    --cc=62426@debbugs.gnu.org \
    --cc=antero@mailbox.org \
    --cc=jporterbugs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).