emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

address@hidden: Re: find-grep makes raw terminal ANSI]


From: Richard Stallman
Subject: address@hidden: Re: find-grep makes raw terminal ANSI]
Date: Thu, 15 Nov 2007 23:29:41 -0500

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: address@hidden
Cc: address@hidden
Subject: Re: find-grep makes raw terminal ANSI
From: address@hidden
Date: Wed, 14 Nov 2007 12:04:20 +0800
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

>>>>> "r" == Richard Stallman <address@hidden> 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 -------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]