From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Highlighting in grep buffer Date: Sun, 11 Apr 2004 01:28:08 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <873c7be197.fsf@mail.jurta.org> References: <87hdvvhzgh.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1081651008 28468 80.91.224.253 (11 Apr 2004 02:36:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2004 02:36:48 +0000 (UTC) Cc: drew.adams@oracle.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Apr 11 04:36:39 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BCUpr-00037g-00 for ; Sun, 11 Apr 2004 04:36:39 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BCUpq-0007iu-00 for ; Sun, 11 Apr 2004 04:36:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BCUpJ-0007lf-7s for emacs-devel@quimby.gnus.org; Sat, 10 Apr 2004 22:36:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BCUnv-0006xv-IB for emacs-devel@gnu.org; Sat, 10 Apr 2004 22:34:39 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BCUnM-0006Z9-8G for emacs-devel@gnu.org; Sat, 10 Apr 2004 22:34:35 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BCUnL-0006Y4-Mg; Sat, 10 Apr 2004 22:34:03 -0400 Original-Received: from mail.jurta.org (80-235-32-66-dsl.mus.estpak.ee [80.235.32.66]) by spoon.dreamhost.com (Postfix) with ESMTP id A5ED013D831; Sat, 10 Apr 2004 19:34:03 -0700 (PDT) Original-To: rms@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21456 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21456 Richard Stallman 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 http://www.jurta.org/emacs/