[Top][All Lists]

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

Re: Highlighting in grep buffer

From: Juri Linkov
Subject: Re: Highlighting in grep buffer
Date: Sun, 11 Apr 2004 01:28:08 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:
> It is quite simple, but I can't understand it at all.
> It needs comments to explain what GREP_COLOR means
> and what that value means and why.

According to grep man page, the environment variable GREP_COLOR
specifies the marker for highlighting, GREP_OPTIONS specifies default
options to be placed in front of any explicit options, and the option
--color surrounds the matching string with the marker found in GREP_COLOR
environment variable.

Actually, markers are ANSI escape sequences like ^[[01;31m and ^[[00m
before and after the matching string.

> It may be less reliable, in that it may not work with non-GNU grep
> programs.  Perhaps that is ok; people should install GNU grep.

Even though this feature will not be available for non-GNU greps,
I can't tell if the GREP_OPTIONS=--colors will cause them to fail.
If so, a new check for the --colors availability could be added to
the grep.el.

But for GNU grep this feature is the most reliable way to find
positions of matching strings.

Juri Linkov

reply via email to

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