From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jidanni@jidanni.org Newsgroups: gmane.emacs.bugs Subject: Re: find-grep makes raw terminal ANSI Date: Wed, 14 Nov 2007 12:04:20 +0800 Message-ID: <877iklqxq3.fsf@jidanni.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195013149 29735 80.91.229.12 (14 Nov 2007 04:05:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2007 04:05:49 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 05:05:53 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Is9Uw-000115-5F for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2007 05:05:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Is9Uj-0000pb-PA for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Nov 2007 23:04:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Is9Ub-0000nT-QW for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2007 23:04:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Is9UX-0000gL-SI for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2007 23:04:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Is9UX-0000g7-IB for bug-gnu-emacs@gnu.org; Tue, 13 Nov 2007 23:04:41 -0500 Original-Received: from lax-green-bigip-5.dreamhost.com ([208.113.200.5] helo=looneymail-a1.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Is9US-0007VH-SS; Tue, 13 Nov 2007 23:04:37 -0500 Original-Received: from jidanni2 (122-127-40-229.dynamic.hinet.net [122.127.40.229]) by looneymail-a1.g.dreamhost.com (Postfix) with ESMTP id B768415DD78; Tue, 13 Nov 2007 20:04:31 -0800 (PST) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16972 Archived-At: >>>>> "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?"