unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: jidanni@jidanni.org
To: rms@gnu.org
Cc: bug-gnu-emacs@gnu.org
Subject: Re: find-grep makes raw terminal ANSI
Date: Wed, 14 Nov 2007 12:04:20 +0800	[thread overview]
Message-ID: <877iklqxq3.fsf@jidanni.org> (raw)
In-Reply-To: E1Is1yq-0008MA-08@fencepost.gnu.org

>>>>> "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?"




      reply	other threads:[~2007-11-14  4:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 19:13 find-grep makes raw terminal ANSI jidanni
2007-11-13 20:03 ` Richard Stallman
2007-11-14  4:04   ` jidanni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877iklqxq3.fsf@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).