Subject: bug#41766: Make it possible to change regexp to identify and highlight grep matches via customization

From: "Basil L. Contovounesios" <[email-masked]>
Date: Tue, 09 Jun 2020 15:32:01 +0100

Simon Lang <[email-masked]> writes:

> I am happy with defvar instead (attached - I changed the commit message
> accordingly). I admit it would not be straight forward to customize anyway
> without doing some research.

Thanks, just some convention tips from me.

> From 724d83a211aae922b719a28cc4f9cc75d88cc4ee Mon Sep 17 00:00:00 2001
> From: Simon Lang <[email-masked]>
> Date: Tue, 9 Jun 2020 13:38:07 +0100
> Subject: [PATCH] Remove hardcoding of regexp used to highlight grep matches.
>
> * lisp/progmodes/grep.el

See etc/CONTRIBUTE for commit message conventions.
In particular, it should list the definitions being changed, e.g.:

* lisp/progmodes/grep.el (grep-match-regexp): New variable.
(grep-filter): Use it.

> ---
>  lisp/progmodes/grep.el | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
> index 7731be5965..618c2935f0 100644
> --- a/lisp/progmodes/grep.el
> +++ b/lisp/progmodes/grep.el
> @@ -353,6 +353,10 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
>  (defvar grep-match-face	'match
>    "Face name to use for grep matches.")
>  
> +(defvar grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m"
> +  "Regular expression matching grep markers to highlight, used
> +in `grep-filter'.")

The first sentence of every docstring should fit on one line;
see (info "(elisp) Documentation Tips").  So you could move the mention
of grep-filter into a sentence of its own.

-- 
Basil