From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [jidanni@jidanni.org: Re: find-grep makes raw terminal ANSI] Date: Thu, 15 Nov 2007 23:29:41 -0500 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1195187686 11315 80.91.229.12 (16 Nov 2007 04:34:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2007 04:34:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 16 05:34:51 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Issuo-0006d3-9m for ged-emacs-devel@m.gmane.org; Fri, 16 Nov 2007 05:34:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Issub-0007l1-DF for ged-emacs-devel@m.gmane.org; Thu, 15 Nov 2007 23:34:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IssuY-0007kt-AF for emacs-devel@gnu.org; Thu, 15 Nov 2007 23:34:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IssuX-0007kh-3i for emacs-devel@gnu.org; Thu, 15 Nov 2007 23:34:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IssuW-0007ke-VX for emacs-devel@gnu.org; Thu, 15 Nov 2007 23:34:33 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Isspq-000055-0o for emacs-devel@gnu.org; Thu, 15 Nov 2007 23:29:42 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1Isspp-0003c1-KS; Thu, 15 Nov 2007 23:29:41 -0500 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83316 Archived-At: He is arguing that setting GREP_COLOR is a mistake and it would be better to put --color into the grep command. What do other people think? ------- Start of forwarded message ------- X-Spam-Status: No, score=0.6 required=5.0 tests=NO_REAL_NAME autolearn=no version=3.1.0 To: rms@gnu.org Cc: bug-gnu-emacs@gnu.org Subject: Re: find-grep makes raw terminal ANSI From: jidanni@jidanni.org Date: Wed, 14 Nov 2007 12:04:20 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> "r" == Richard Stallman writes: r> I am lost. Allow us to take the case of (find-grep "find /etc/passwd -type f -print0 | xargs -0 -e grep -nH -e roo") which works fine unless one then smacks at the end an additional filter: (find-grep "find /etc/passwd -type f -print0 | xargs -0 -e grep -nH -e roo|grep :root") Grep finished with no matches found at Wed Nov 14 12:03:40 whereas the same command in the shell finds something: $ find /etc/passwd -type f -print0 | xargs -0 -e grep -nH -e roo|grep :root /etc/passwd:1:root:x:0:0:root:/root:/bin/bash Thus the user walks away thinking there was nothing to be found, when all along what is happening is that ANSI terminal control characters are being injected, as can be seen with (find-grep "find /etc/passwd -type f -print0 | xargs -0 -e grep -nH -e roo|cat -v") Thus the user is mislead thinking he can merely extend the UNIX filter by another pipe, but instead unwittingly throwing away valid matches. ANSI terminal codes have no business being injected at this layer of the program. Wait, I see what is going on, 12 matches for "highlight" in buffer: grep.el.gz 7 matches for "color" in buffer: grep.el.gz, (including "The deprecated environment variable GREP_COLOR." as noted on grep(1).) It would be much better to put --color right there in the command line where the user can be aware of what is going on. But that line is already crowded. Anyway, just wanted to let you know "I told the boss that we have no record of that client, when all along that color jazz undermined my extra search filter. How was I to know?" ------- End of forwarded message -------