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

From: Simon Lang <[email-masked]>
Date: Sat, 13 Jun 2020 09:48:13 +0000

Thank you!

Attached pls find the revised patch.

Simon

________________________________________
From: Eli Zaretskii <[email-masked]>
Sent: 13 June 2020 07:50
To: Simon Lang
Cc: [email-masked]; [email-masked]; [email-masked]; [email-masked]
Subject: Re: bug#41766: Make it possible to change regexp to identify and highlight grep matches via customization

> From: Simon Lang <[email-masked]>
> CC: "[email-masked]" <[email-masked]>, "[email-masked]"
>       <[email-masked]>, "[email-masked]" <[email-masked]>
> Date: Wed, 10 Jun 2020 21:11:09 +0000
>
> I now something to the manual, NEWS and changed the doc string + commit msg as advised. I decided on defcustom in the end because this way it is easy for the user to figure out what goes wrong in case he/she modifies grep-command and highlighting is missing. Hope that is fine.
>
> Pls let me know if there is anything else I need to change.

Thanks, a few minor comments below.

> +by grep.  The matching of the sequences is controlled by
> +@code{grep-match-regexp}, which can be customize to accommodate
> +different grep programs.               ^^^^^^^^^

Typo: should be "customized".

Also, "grep" should be "Grep".

> +** Grep changes:
> +
> +*** New variable 'grep-match-regexp' matches grep markers to highlight.
> +Grep emits SGR ANSI escape sequences to color its output. The new variable
> +'grep-match-regexp' holds the regular expression to match the appropriate
> +markers in order to provide highlighting in the source buffer. The variable
> +can be customized to accommodate other grep-like tools.

Please leave 2 spaces between sentences, per our conventions.
> +(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m"
> +  "Regular expression matching grep markers to highlight.
> +It matches SGR ANSI escape sequences which are emitted by grep to
> +color its output. This variable is used in `grep-filter'."

Likewise here.