From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov 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: Wed, 10 Jun 2015 02:32:35 +0300 Organization: LINKOV.NET Message-ID: <87fv608nl8.fsf@mail.linkov.net> References: <86bngws6il.fsf@yandex.ru> <838ubzqzz5.fsf@gnu.org> <55706C5F.6070903@yandex.ru> <833827qyg5.fsf@gnu.org> <55707074.8010607@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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433894181 17918 80.91.229.3 (9 Jun 2015 23:56:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2015 23:56:21 +0000 (UTC) Cc: 20728@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 10 01:56:10 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 1Z2TNH-000633-RU for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Jun 2015 01:56:07 +0200 Original-Received: from localhost ([::1]:37294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2TNH-0002Oy-6d for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2015 19:56:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2TND-0002Og-Og for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 19:56:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2TNA-0006Ug-Iu for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 19:56:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2T2t-00068Z-9d for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 19:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z2T2s-0003Xd-RS for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2015 19:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jun 2015 23:35: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.143389287013569 (code B ref 20728); Tue, 09 Jun 2015 23:35:02 +0000 Original-Received: (at 20728) by debbugs.gnu.org; 9 Jun 2015 23:34:30 +0000 Original-Received: from localhost ([127.0.0.1]:46499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2T2L-0003Wm-Kt for submit@debbugs.gnu.org; Tue, 09 Jun 2015 19:34:30 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:33322 helo=homiemail-a15.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2T2I-0003Wa-PF for 20728@debbugs.gnu.org; Tue, 09 Jun 2015 19:34:27 -0400 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 46ACC76C079; Tue, 9 Jun 2015 16:34:25 -0700 (PDT) Original-Received: from localhost.linkov.net (m213-102-136-198.cust.tele2.ee [213.102.136.198]) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPA id 0D80176C073; Tue, 9 Jun 2015 16:34:23 -0700 (PDT) In-Reply-To: <5574C427.3070007@yandex.ru> (Dmitry Gutov's message of "Mon, 8 Jun 2015 01:22:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) 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:103781 Archived-At: > No problem. Could you explain what those filters are, the ones the comment > says zgrep puts into output? These are pipe filters. You can see how complex is the command line constructed in /bin/zgrep > I meant template substitution, like in grep-expand-template. > > Not sure what to do about grep-default-command, but if leaving it as-is is > not an option, we can reasonably decide that the grep-command was the > symbol at the beginning of the previous command. Then you want two additional placeholders: for the command name and options? >> But I see no problem with >> both zrgrep and the code where you want to parse the output programmatically, >> to remember the computed command lines in defvar variables such as >> zgrep-find-command, zgrep-find-template, etc. to not compute them every >> time the command is called. > > Again, why have zgrep-find-template, when grep-find-template could have > a (new) placeholder for grep-command? Do zgrep and grep take > different options? In an older version of /bin/zgrep I see the text "OPTIONs are the same as for 'grep'." I don't know about other versions. >> When parameters don't vary between command calls (as regexps and files do) >> then I think it's better to prepare them in the command line templates. > > Since grep-command and grep-highlight-matches can vary between calls, > should we make a template placeholder for them? There are only two possible values for grep-highlight-matches whereas the number of possible values of the current placeholders for regexps and filenames is infinite. I think the rule should be the following: placeholders are needed only for parameters provided by users, but for internal implementation parameters it's enough to pre-compute command lines (and cache them). PS: Somehow reminds me of endless discussions about distinctions between `error' and `user-error' :)