GNU bug report logs - #20728
25.0.50; grep and grep-find templates should have a place holder for the --color argument

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Wed, 3 Jun 2015 23:44:01 UTC

Severity: normal

Found in version 25.0.50

Fixed in version 25.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #71 received at 20728 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 20728 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#20728: 25.0.50; grep and grep-find templates should have a
 place holder for the --color argument
Date: Sat, 6 Jun 2015 13:19:34 +0300
On 06/06/2015 01:17 AM, Juri Linkov wrote:

> There is also grep-find-command used by grep-find.

Indeed. That one I'd rather leave alone too.

> Since there is a lot of %s-substitutions in grep-compute-defaults
> that produce command lines depending on many customizations,

Not that many. grep-program and grep-highlight-matches seem to be the 
only ones a user might want to change. Or rather, a user might change 
the former, and some function might want to change either.

> yet another option is to let-bind the variables grep-command,
> grep-find-command, grep-template, grep-find-template in your function,
> then call grep-compute-defaults with a new value of grep-highlight-matches,
> and then get new command lines without the --color option from
> these local bindings to run them and parse the output programmatically.

That's what zrgrep does, and its quite clunky. And if we have code to 
pre-compute commands and templates (which takes several external program 
calls), it's kind of silly to redo that again each time certain commands 
are called.

Do you know if zrgrep has a good reason for it? Like, it there are 
platforms where we have to use different calling conventions for grep 
and zgrep? Otherwise, we could simply substitute grep-program value in 
the commands.

> In case when users customize grep-highlight-matches interactively,
> its defcustom should compute new command lines using grep-compute-defaults.

Do you think, overall, it will be the better approach?




This bug report was last modified 10 years and 4 days ago.

Previous Next


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