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: Thu, 08 Apr 2004 07:21:18 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87hdvvhzgh.fsf@mail.jurta.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1081398408 7146 80.91.224.253 (8 Apr 2004 04:26:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Apr 2004 04:26:48 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Apr 08 06:26:43 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 1BBR7j-00081B-00 for ; Thu, 08 Apr 2004 06:26:43 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BBR7h-00062K-00 for ; Thu, 08 Apr 2004 06:26:41 +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 1BBR5m-0004V8-I5 for emacs-devel@quimby.gnus.org; Thu, 08 Apr 2004 00:24:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BBR5f-0004Tj-Br for emacs-devel@gnu.org; Thu, 08 Apr 2004 00:24:35 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BBR58-0004Iy-BA for emacs-devel@gnu.org; Thu, 08 Apr 2004 00:24:33 -0400 Original-Received: from [66.33.219.4] (helo=spork.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BBR3a-0003iD-IW; Thu, 08 Apr 2004 00:22:26 -0400 Original-Received: from mail.jurta.org (80-235-33-231-dsl.mus.estpak.ee [80.235.33.231]) by spork.dreamhost.com (Postfix) with ESMTP id CCDAB11DC0F; Wed, 7 Apr 2004 21:22:23 -0700 (PDT) Original-To: "Drew Adams" 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:21344 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21344 Isn't something like this a simpler and more reliable solution? *** emacs/lisp/progmodes/grep.el 11 Mar 2004 22:56:19 -0000 1.10 --- emacs/lisp/progmodes/grep.el 8 Apr 2004 00:37:46 -0000 *************** *** 281,288 **** --- 281,291 ---- (defun grep-process-setup () "Setup compilation variables and buffer for `grep'. Set up `compilation-exit-message-function' and run `grep-setup-hook'." + (setenv "GREP_OPTIONS" "--color=always") + (setenv "GREP_COLOR" "01;31") (set (make-local-variable 'compilation-exit-message-function) (lambda (status code msg) + (ansi-color-apply-on-region (point-min) (point-max)) (if (eq status 'exit) (cond ((zerop code) '("finished (matches found)\n" . "matched")) The matching positions returned by grep could be also used instead of `highlight-regexp' to highlight substrings in visited source lines. -- Juri Linkov http://www.jurta.org/emacs/