unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [jidanni@jidanni.org: Re: find-grep makes raw terminal ANSI]
@ 2007-11-16  4:29 Richard Stallman
  2007-11-16 21:54 ` Juri Linkov
  0 siblings, 1 reply; 17+ messages in thread
From: Richard Stallman @ 2007-11-16  4:29 UTC (permalink / raw)
  To: emacs-devel

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 <rms@gnu.org> 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 -------

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-11-19 16:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-16  4:29 [jidanni@jidanni.org: Re: find-grep makes raw terminal ANSI] Richard Stallman
2007-11-16 21:54 ` Juri Linkov
2007-11-17  4:24   ` Stefan Monnier
2007-11-17 15:32     ` Juri Linkov
2007-11-17 17:28       ` Drew Adams
2007-11-17 22:50         ` Eli Zaretskii
2007-11-17 23:04           ` Drew Adams
2007-11-18  0:29           ` David Kastrup
2007-11-18  4:14             ` Eli Zaretskii
2007-11-17 22:54         ` Juri Linkov
2007-11-18  3:18       ` Stefan Monnier
2007-11-18 10:45         ` Andreas Schwab
2007-11-18 12:05         ` Juri Linkov
2007-11-19 16:00           ` Stefan Monnier
2007-11-18 22:45         ` Richard Stallman
2007-11-17 23:30   ` Richard Stallman
2007-11-17 23:59     ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).