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 #163 received at 20728 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20728 <at> debbugs.gnu.org
Subject: Re: bug#20728: 25.0.50; grep and grep-find templates should have a
 place holder for the --color argument
Date: Mon, 29 Jun 2015 19:11:19 +0300
On 06/29/2015 06:26 PM, Eli Zaretskii wrote:

>> On the other hand, we might want to choose to set
>> `grep-highlight-matches' to `always' in grep-compute-defaults,
>> irrespective of the OS.
>
> Won't that bring back the problem in symref/grep.el again?

Why would it?

The replace (replace-regexp-in-string "--color=always" ...) call is 
still there. I didn't change that because CEDET supposedly needs to 
retain compatibility with previous Emacs versions.

But there is a similar function: xref-collect-matches.

Looking at it now, I forgot to apply a relevant fix to it (and this is 
an example of a Lisp code author doing the wrong thing because `auto' 
happened to make things right anyway, on my machine). So could you:

- Try M-x xref-find-regexp on a Windows machine (in an Elisp buffer, 
enter something like "xref-find-").
- Probably see it fail for the same reason as symref/grep.el did previously.
- Apply the patch below.
- Hopefully see it succeed and write back about that.

> Assuming we can count on commands that live far away, like
> symref/grep.el, to make a point of doing this, it will work, of
> course.

The idea is to force their authors to do it (because the commands won't 
work otherwise).

Patch:

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 50d52d0..bb2546f 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -749,8 +749,10 @@ tools are used, and when."
   (require 'semantic/fw)
   (grep-compute-defaults)
   (defvar grep-find-template)
+  (defvar grep-highlight-matches)
   (let* ((grep-find-template (replace-regexp-in-string "-e " "-E "

grep-find-template t t))
+         (grep-highlight-matches nil)
          (command (rgrep-default-command (xref--regexp-to-extended regexp)
                                          "*.*" dir))
          (orig-buffers (buffer-list))






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

Previous Next


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