help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How should a clone of the `grep` program highlight matches for Emacs


From: Michael Heerdegen
Subject: Re: How should a clone of the `grep` program highlight matches for Emacs?
Date: Sat, 27 Jun 2015 17:22:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Raffaele Ricciardi <rfflrccrd@gmail.com> writes:

> I am writing an Emacs script as a replacement for the `grep` program
> while executing the `rgrep` command.  Now, I can't make my Emacs
> script highlight the matches in a way that Emacs understands.

Do you want to use this script from M-x grep?  I assume "yes".

AFAICT grep.el highlights matches via a grep-mode defined as kind of a
compilation-mode.  The way of highlighting is defined in
`grep-regexp-alist'.  Other things are highlighted via font-lock
keywords.  Of course be sure to bind grep-highlight-matches non-nil.
But in general, grep-mode should be able to highlight as you want it.

My first guess is that might be help to set grep-highlight-matches to
always -- note that this option has a :set custom specification!

If that doesn't help, please show us some code!


Regards,

Michael.



reply via email to

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