From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#62426: [PATCH] eshell: Add 'rgrep' builtin. Date: Sat, 25 Mar 2023 12:07:37 -0700 Message-ID: <314663e3-ff4e-814c-6ff7-6ab3376ef458@gmail.com> References: <87jzz5eucl.fsf@mailbox.org> <87355syce8.fsf@athena.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20961"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Antero Mejr , 62426@debbugs.gnu.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 20:08:35 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pg9Fi-0004yh-V3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 20:08:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg9FF-0001o9-2D; Sat, 25 Mar 2023 15:08:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg9FD-0001o1-OI for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 15:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg9FC-0005cj-Rd for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 15:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg9FB-0001uR-NB for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 15:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2023 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62426 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62426-submit@debbugs.gnu.org id=B62426.16797712687316 (code B ref 62426); Sat, 25 Mar 2023 19:08:01 +0000 Original-Received: (at 62426) by debbugs.gnu.org; 25 Mar 2023 19:07:48 +0000 Original-Received: from localhost ([127.0.0.1]:43499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg9Ey-0001tw-IY for submit@debbugs.gnu.org; Sat, 25 Mar 2023 15:07:48 -0400 Original-Received: from mail-pl1-f179.google.com ([209.85.214.179]:43670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg9Ev-0001tf-3T for 62426@debbugs.gnu.org; Sat, 25 Mar 2023 15:07:46 -0400 Original-Received: by mail-pl1-f179.google.com with SMTP id kc4so4763977plb.10 for <62426@debbugs.gnu.org>; Sat, 25 Mar 2023 12:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679771259; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=/WAXIJSrZZJl7HnnTGN/smygMI2lKT6icU6KC+yKln0=; b=nOGXnA8yVLcnNSfsujPau0eiT22eMKdNszpLxH1UVUWz6mcxCv248M6JsCspP3utXj yX/AP/wDDEaXl0Fc+qtk6XCTvWVeQEUgGgctzjbW4rrcV1gmHM20J/cBLOznRnJ+Q6M7 loFiczGShPiDtT0M+LR4tOse2gtjgAuYsXNNuKJO4K9qLeQYuhYTmdnR9Zjjh+DZcwIZ orTyf70cHx/f3Q8sWOhhZ2ssyMPiaWBqTZlf0wYW+3vGMv15w0pQnXYI1w98f+5kxtfS qSEep3lrWA+I9K0aFGU7Rb+QPmB/W3w16nXNssiQPRz1nCddHtas5JNitcoX4TQKSFk7 RNQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679771259; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/WAXIJSrZZJl7HnnTGN/smygMI2lKT6icU6KC+yKln0=; b=DuVeATy33JDgrP9AhHlMbEzC0JtC1ciqUanT24ASOeJ9/UsxOTf6O7C/WbrKXiveU8 1HEWQlPMtTVmMuMfe/du/0TCCvKxEIqCMzSaC9PG+9v68UJby7TGSkL0iVy9lMfK7kCh zwXqra9iDCeqk1Jx7hJkb1iQXw0EgmqG5S/qWY+yqx5QxfV2qD7kyRYQ5umJoKUbZeFS cViBhXEpD8fcxDo/uc7H30nQXwypJoeRFm9jwilFF2WzIq8bNR+8PD/qc/lJa2Hi9Sck +y+bdXofNn35yzDv72gWei/0JroNvMqn7zUCTRtAaPdoF2jlSAvEN+Bc3ilBZdJsEsUW YATg== X-Gm-Message-State: AO0yUKUkuQ3QAwaDrXqox8nebY5HL9EjUAAqL4viAXigUwIgAemRz6ul FpwBZ0B3wPQEnLbfnOITqPs= X-Google-Smtp-Source: AK7set/eaVirvl0Vom4ygvleiFtWEfMTe15oEOXiVwOb3erizx7al66a4AeFNG9tj/3rdu3wNWCDhA== X-Received: by 2002:a05:6a20:4ca6:b0:d7:87ce:671e with SMTP id fq38-20020a056a204ca600b000d787ce671emr6247897pzb.52.1679771259081; Sat, 25 Mar 2023 12:07:39 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id f19-20020aa78b13000000b0062cb3c8896dsm1578962pfd.142.2023.03.25.12.07.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Mar 2023 12:07:38 -0700 (PDT) Content-Language: en-US In-Reply-To: <87355syce8.fsf@athena.silentflame.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258617 Archived-At: On 3/25/2023 10:22 AM, Sean Whitton wrote: > 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. It wouldn't be too difficult to add Pcomplete support for an "rgrep" Eshell command that calls 'M-x rgrep' under the hood. There's no reason you'd *have* to explicitly type all three arguments to 'M-x rgrep' on the command line. (Though doing this the Right Way would take a bit of effort, since we'd probably want 'eshell-eval-using-options' to automatically generate the appropriate Pcomplete function.) 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. > Given this, I suggest rgrep in Eshell should be /usr/bin/rgrep. 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.)