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


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 20728 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#20728: 25.0.50; grep and grep-find templates should have a place holder for the --color argument
Date: Sat, 06 Jun 2015 01:17:52 +0300
> We'll still need that placeholder in grep-find-template (and probably in
> grep-template, for consistency).
>
> Regarding M-x grep, I would rather leave it alone for now, because
> otherwise, %s or not, that would call for renaming the variable
> grep-command, and grep-template is already taken.

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

> Another option would be to perform the substitution with regexp in
> grep-default-command, and it's pretty hairy already.

Since there is a lot of %s-substitutions in grep-compute-defaults
that produce command lines depending on many customizations,
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.

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




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.