From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jao Newsgroups: gmane.emacs.bugs Subject: bug#70507: 30.0.50; eshell: grep -H and -n flags are hardcoded and the latter cannot be overwritten Date: Mon, 20 May 2024 21:56:39 +0100 Message-ID: <87a5kk8ans.fsf@mail.jao.io> References: <87plui421d.fsf@mail.jao.io> <79d16d39-e024-b65a-bcb1-827f04dc6a78@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 70507@debbugs.gnu.org, Stefan Kangas To: "Jim Porter" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 20 22:57:13 2024 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 1s9A4H-0007a4-FU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 May 2024 22:57:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9A43-0001YS-AH; Mon, 20 May 2024 16:56:59 -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 1s9A41-0001YC-HR for bug-gnu-emacs@gnu.org; Mon, 20 May 2024 16:56:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s9A41-0006Xr-6X for bug-gnu-emacs@gnu.org; Mon, 20 May 2024 16:56:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9A45-0001UG-T5 for bug-gnu-emacs@gnu.org; Mon, 20 May 2024 16:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: jao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 May 2024 20:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70507 X-GNU-PR-Package: emacs Original-Received: via spool by 70507-submit@debbugs.gnu.org id=B70507.17162386175707 (code B ref 70507); Mon, 20 May 2024 20:57:01 +0000 Original-Received: (at 70507) by debbugs.gnu.org; 20 May 2024 20:56:57 +0000 Original-Received: from localhost ([127.0.0.1]:44752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9A41-0001Tz-1A for submit@debbugs.gnu.org; Mon, 20 May 2024 16:56:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9A3x-0001Tt-QZ for 70507@debbugs.gnu.org; Mon, 20 May 2024 16:56:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9A3n-0006UN-NQ; Mon, 20 May 2024 16:56:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=vgxRy55+gbJXuBU6L0/Y6uecAjjys1b5lS79C4ZZTyg=; b=gLdWa+GoEV/nTdJihBlv /kGleMCu8WEn27wou51Ie4wCTrbWEw18/oRmIVf+a8zf39sYrTlPPDVoJepFPEW8i5lQGM7PPE1OG Hgekx1GWeot2sqRlCw3RbgwojuhIqApUf0oI7tQdvTv8kkMJTAl6l6D64cyROlqSwO9xzaOu2gr7z sxeMSpvG0Gnrlfj9aVGhFmJGjU5JWl/ECK8fRfLv/tUaOj+gdL6xCzZgz0AY6tF2NiCpg8Y5sdlop cRN6kKr60RowDAcb6Pcgy39MVQOcjkwYhSswJ/Z+KzKJkaNnKkwnyzuUrJKN5T2NxkqYmj0Jfpm3m fysnDsSdy0EL2g==; In-Reply-To: <79d16d39-e024-b65a-bcb1-827f04dc6a78@gmail.com> (Jim Porter's message of "Mon, 20 May 2024 13:52:29 -0700") X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: 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:285508 Archived-At: On Mon, May 20 2024, Jim Porter wrote: > On 5/20/2024 1:18 PM, Stefan Kangas wrote: >> Jose A Ortega Ruiz writes: >> >>> I've noticed that -Hn flags are hardcoded when calling eshell's grep >>> command. Specially in pipes, where -H prints a noisy (standard input) >>> prefix for every line, those flags are rarely what I personally want, >>> and I'd like to have the option to disable them. For -H i can add -h to >>> the call, or even redefine eshell/grep to not use -H, but there's no >>> flag to disable -n. >> >> Jim, any comments on the above bug report? > > It would probably be reasonable to define some new > 'eshell-grep-default-interactive-flags' variable, defaulting to "-nH" > and only taking effect when being redirected to a compilation buffer. > Maybe 'eshell-compile' could also take an EXTRA-ARGS argument that holds > extra args to use. There are a few edge cases here I haven't fully > though through, so maybe this is all wrong. > > In the short term though, you have a few options: > > 1. "alias grep '*grep $@*'": This just makes "grep" always use the real > "grep" program on your computer, with no fancy compilation buffers. > > 2. "alias grep 'compile --mode=3Dgrep-mode grep $@*'": This ensures that > "grep" opens in a compilation buffer when called interactively (and not > in a pipeline, etc), but only with the flags you explicitly specify. Thanks for your feedback. For my use cases, solution 2 is probably covering all the bases. Cheers, jao --=20 =E2=80=9CI=E2=80=99m all these words, all these strangers, this dust of wor= ds, with no ground for their setting, no sky for their dispersing.=E2=80=9D - Samuel Beckett, The Unnamable