unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: rms@gnu.org, Drew Adams <drew.adams@oracle.com>, emacs-devel@gnu.org
Subject: Re: Highlighting in grep buffer
Date: 08 Apr 2004 12:38:42 -0400	[thread overview]
Message-ID: <87isgafmte.fsf-monnier+emacs@alfajor.local> (raw)
In-Reply-To: <87hdvvhzgh.fsf@mail.jurta.org>

>   (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"))

Sounds like a good idea.  The call to ansi-color-apply-on-region should
probably be in the process filter so it's applied on-the-fly rather than at
the end of the command, but that can be changed later on (I think it
requires more changes).

> The matching positions returned by grep could be also used instead of
> `highlight-regexp' to highlight substrings in visited source lines.

How can you get `grep' to return matching positions?


        Stefan

  reply	other threads:[~2004-04-08 16:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-05 22:03 Highlighting in grep buffer Richard Stallman
2004-04-05 23:05 ` Drew Adams
2004-04-07 17:45   ` Richard Stallman
2004-04-07 18:16     ` Drew Adams
2004-04-08  4:21       ` Juri Linkov
2004-04-08 16:38         ` Stefan Monnier [this message]
2004-04-10 22:29           ` Juri Linkov
2004-04-11 23:20             ` Stefan Monnier
2004-05-06  8:55               ` Juri Linkov
2004-05-06 14:39                 ` Stefan Monnier
2004-05-06 21:03                   ` Miles Bader
2004-05-08 21:46                   ` Juri Linkov
2004-04-09 22:46         ` Richard Stallman
2004-04-10 22:28           ` Juri Linkov
2004-04-12  3:52             ` Richard Stallman
2004-04-12  4:32               ` Miles Bader
     [not found] <DNEMKBNJBGPAOPIJOOICMEGCCAAA.drew.adams@oracle.com>
2004-04-13 11:45 ` Juri Linkov

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=87isgafmte.fsf-monnier+emacs@alfajor.local \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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).