emacs-devel
[Top][All Lists]
Advanced

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

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


From: Juri Linkov
Subject: Re: address@hidden: Re: find-grep makes raw terminal ANSI]
Date: Fri, 16 Nov 2007 23:54:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> He is arguing that setting GREP_COLOR is a mistake

GREP_COLOR is for compatibility with older grep versions.
grep.el also uses GREP_COLORS for newer versions.
So everything in this regard is already correct in grep.el.

> and it would be better to put --color into the grep command.

Currently grep.el adds " --color=always" to the environment variable
GREP_OPTIONS instead of putting this argument into the grep command.

The disadvantage of putting " --color=always" into the grep command is
that it makes the grep command line too long to edit in the minibuffer
before running.  The advantage of putting it into the command line is
that it will allow the user to be aware what is going on and to write
the correct grep command line.  For instance, with using explicit --color
argument the correct command line in the OP's example perhaps would be

(find-grep "find /etc/passwd -type f -print0 | xargs -0 -e \
grep --color=none -nH -e r|\
grep --color=always :root")

But without putting the --color argument to the minibuffer initially
it is not evident that the user can use this argument to control
highlighting.  So the presence of --color in the command line will
provide a hint for the user how to control the grep highlighting.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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