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 18:01:58 +0300 Message-ID: <55915DE6.3030108@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> 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 1435590214 6835 80.91.229.3 (29 Jun 2015 15:03:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2015 15:03:34 +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 17:03:17 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 1Z9aab-0004sr-6N for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 17:03:17 +0200 Original-Received: from localhost ([::1]:42638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aaa-0003XS-FN for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 11:03:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aaS-0003Qt-Th for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 11:03:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9aaM-0005aU-VS for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 11:03:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aaM-0005aK-RC for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 11:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z9aaM-0007ma-DS for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 11:03: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 15:03: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.143559012829831 (code B ref 20728); Mon, 29 Jun 2015 15:03:02 +0000 Original-Received: (at 20728) by debbugs.gnu.org; 29 Jun 2015 15:02:08 +0000 Original-Received: from localhost ([127.0.0.1]:33076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9aZU-0007l4-2U for submit@debbugs.gnu.org; Mon, 29 Jun 2015 11:02:08 -0400 Original-Received: from mail-wi0-f174.google.com ([209.85.212.174]:38874) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9aZR-0007ka-TH for 20728@debbugs.gnu.org; Mon, 29 Jun 2015 11:02:06 -0400 Original-Received: by wibdq8 with SMTP id dq8so74999377wib.1 for <20728@debbugs.gnu.org>; Mon, 29 Jun 2015 08:02:00 -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=DBGiclsoz3ec3vZBkSK8TiXL5d4b908ngxUfaztw7/o=; b=c87etTENU50LsT0eTjlopaeDzWwA76VtUy2cL6aq8G/i8juXWrbooUL5RqkUK7r9Lt JM4+2/bW6Ba78FXr2/SycbvSY3KCfnr66dkIYRzusXlzKVDQWEa0DF5rPuiQMlhwt9oh Q5iRUPnJ9+RvESYqByUy02MAUgYSasfPjcIH41mKKTPY3288Ymb83/7BB/egFRlKoiID sEJGv5rOI6g0yQ1wm9pO4kBqO9270f8GGjUu/aKHQ/Vum4oI1KBng9d9c2WNMw3WIZ1P nYAF4Du3FulvsUZEGiDvBvVRzVGurqAjNRNxMiTtjOwzShQUegtbRcGKLh42M/Ongu4c qZSQ== X-Received: by 10.194.175.65 with SMTP id by1mr31974117wjc.152.1435590120209; Mon, 29 Jun 2015 08:02:00 -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 q4sm64409929wja.24.2015.06.29.08.01.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:02:00 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <8361666035.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:104488 Archived-At: On 06/29/2015 05:49 PM, Eli Zaretskii wrote: >>> We could, if we want to test Grep's output ourselves. That is, we >>> will have to decide when to bind it to nil and when to non-nil, >> >> What do you mean by "test"? > > "Examine". The behavior with pipes, files, consoles, and ptys is > different. I don't understand this. Grep's output happens after we bind, or not bind, this variable. So we can't test in beforehand (or do you mean in `grep-compute-defaults'?). >> My point is, we have to decide whether to highlight matches or not, if >> only to be compatible with Windows. And by "we", I mean in the >> implementation of each given command. > > Yes, the alternative is to do everything in Lisp, and then use only > "--color=no" or "--color=always", as appropriate. That's what I'm proposing. This seems simpler and less error-prone. So this discussion is about the possible downsides. >> Whether we want a given command to use a colorized Grep output, is not >> dependent on the OS, is it? > > I don't think so. But it might depend on the values of grep-program > etc., i.e. on user customizations. Users might want to put shell > scripts or pipelines there. Well, okay. If it's a significant use case, we might want to continue supporting it. On the other hand, we might want to choose to set `grep-highlight-matches' to `always' in grep-compute-defaults, irrespective of the OS. So that every command that knows it does not need the ANSI codes, will bind this variable to nil without relying on auto-detection thanks to calling Grep via a pipe. Then we won't have to test on Windows to find bugs like that. And if a user customized grep-program, etc, to unexpectedly postprocess Grep ouput using a pipe, they can customize `grep-highlight-matches' to `auto' as well.