From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <55916E27.3010200@yandex.ru> References: <86bngws6il.fsf@yandex.ru> <83zj4fpjof.fsf@gnu.org> <557082F7.8020400@yandex.ru> <83wpzjpf6o.fsf@gnu.org> <55708EEA.6020400@yandex.ru> <83twunp9bf.fsf@gnu.org> <5570B30F.4090503@yandex.ru> <83oakuprpf.fsf@gnu.org> <55715DE3.6000405@yandex.ru> <83h9qmpm2s.fsf@gnu.org> <557166CE.4050906@yandex.ru> <83d21apkyg.fsf@gnu.org> <55717030.6010005@yandex.ru> <87a8wdhka7.fsf@mail.linkov.net> <5572C936.6070505@yandex.ru> <874mmkfq7q.fsf@mail.linkov.net> <5574C427.3070007@yandex.ru> <87fv608nl8.fsf@mail.linkov.net> <55787A1D.9080601@yandex.ru> <87wpzbaztk.fsf@mail.linkov.net> <55793756.9070505@yandex.ru> <87a8w53k8z.fsf@mail.linkov.net> <558F1186.50303@yandex.ru> <834mls7dvr.fsf@gnu.org> <558FAAE0.6020805@yandex.ru> <83381b7vez.fsf@gnu.org> <559044BD.4030703@yandex.ru> <83fv5b60j0.fsf@gnu.org> <559059A2.2050209@yandex.ru> <83egkv5jhl.fsf@gnu.org> <55911930.4020203@yandex.ru> <8361666035.fsf@gnu.org> <55915DE6.3030108@yandex.ru> <83twtq4jtd.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435594350 14465 80.91.229.3 (29 Jun 2015 16:12:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2015 16:12:30 +0000 (UTC) Cc: 20728@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 29 18:12:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z9bfL-0006So-Gd for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 18:12:15 +0200 Original-Received: from localhost ([::1]:43040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9bfK-0003SB-Nh for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 12:12:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9bfC-0003Lb-7Q for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 12:12:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9bf8-0000n0-UT for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 12:12:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9bf8-0000mu-RZ for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 12:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z9bf8-0002Zw-EQ for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jun 2015 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20728 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20728-submit@debbugs.gnu.org id=B20728.14355942899869 (code B ref 20728); Mon, 29 Jun 2015 16:12:02 +0000 Original-Received: (at 20728) by debbugs.gnu.org; 29 Jun 2015 16:11:29 +0000 Original-Received: from localhost ([127.0.0.1]:33185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9bea-0002Z6-Fd for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:11:28 -0400 Original-Received: from mail-wi0-f173.google.com ([209.85.212.173]:34106) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9beY-0002Yu-To for 20728@debbugs.gnu.org; Mon, 29 Jun 2015 12:11:27 -0400 Original-Received: by wiar9 with SMTP id r9so9095089wia.1 for <20728@debbugs.gnu.org>; Mon, 29 Jun 2015 09:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=fqxkYnjcSNUhubRxcyemp9i5WR1GebWqtcU4gKpEymg=; b=DBC6xBXokHOBgEaj3VrgWaR8Xe8h1bLqnp32mFGfb/6f6UbpxDKq0vB6KhahLUZyZ6 VH4egkEDwAWDs51UGh9Ji2pR5PCBjuy4FQa0YGGAOV9jURtFZp+1Yj7KC834v7oGkNyr hioRxKzmKdO+rISQXJAyp/hV6TA4aB07vlB81fXd8bHG749Nbtf/1wVrSbtFnwv+pck3 jZfhV9iGYBCknEgcu2atYW2wjtm/mgv+p0kAkv/JAdavur++hPQhRYohFihNvZwzW1Cy AyzZEZvOd2eiM/sI8COl2AEc8RT/Ukd7mupV/LuiuTiTpRoKSixdJz7TYunu8FRnOlca qliw== X-Received: by 10.194.23.225 with SMTP id p1mr31841224wjf.155.1435594281447; Mon, 29 Jun 2015 09:11:21 -0700 (PDT) Original-Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id v3sm13297425wiy.1.2015.06.29.09.11.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 09:11:21 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <83twtq4jtd.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104499 Archived-At: 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))