GNU bug report logs - #41766
Make it possible to change regexp to identify and highlight grep matches via customization

Previous Next

Package: emacs;

Reported by: Simon Lang <simon.lang <at> outlook.com>

Date: Mon, 8 Jun 2020 21:32:02 UTC

Severity: normal

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 41766 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Simon Lang <Simon.lang <at> outlook.com>
Cc: contovob <at> tcd.ie, juri <at> linkov.net, 41766 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#41766: Make it possible to change regexp to identify and
 highlight grep matches via customization
Date: Sat, 13 Jun 2020 09:50:16 +0300
> From: Simon Lang <Simon.lang <at> outlook.com>
> CC: "41766 <at> debbugs.gnu.org" <41766 <at> debbugs.gnu.org>, "dgutov <at> yandex.ru"
> 	<dgutov <at> yandex.ru>, "juri <at> linkov.net" <juri <at> linkov.net>
> 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.




This bug report was last modified 4 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.