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

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

bug#41766: Make it possible to change regexp to identify and highlight g


From: Simon Lang
Subject: bug#41766: Make it possible to change regexp to identify and highlight grep matches via customization
Date: Tue, 9 Jun 2020 12:45:18 +0000

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!


________________________________________
From: Basil L. Contovounesios <contovob@tcd.ie>
Sent: 09 June 2020 12:55
To: Simon Lang
Cc: Dmitry Gutov; 41766@debbugs.gnu.org; Juri Linkov
Subject: Re: bug#41766: Make it possible to change regexp to identify and 
highlight grep matches via customization

Simon Lang <Simon.lang@outlook.com> writes:

> From bc9b736ff20a03e831bc5110283ccf9241127773 Mon Sep 17 00:00:00 2001
> From: Simon Lang <simon.lang@outlook.com>
> Date: Mon, 8 Jun 2020 20:47:08 +0100
> Subject: [PATCH] Make regexp used to highlight grep matches customizable
>
> * lisp/progmodes/grep.el
> ---
>  lisp/progmodes/grep.el | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
> index 7731be5965..3f0c99f6dc 100644
> --- a/lisp/progmodes/grep.el
> +++ b/lisp/progmodes/grep.el
> @@ -100,6 +100,9 @@ To change the default value, use \\[customize] or call 
> the function
>    :set #'grep-apply-setting
>    :version "22.1")
>
> +(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m"
> +  "Regex definition to identify grep markers to highlight matches.")

Nit: How about "Regular expression matching grep markers to highlight."

Every defcustom also needs:

  :type 'regexp
  :version "28.1"

as well as possibly being announced in etc/NEWS.

I wonder, though: the default value matches some quite obscure codes
which aren't (and maybe shouldn't be) documented, so is a defcustom
really suitable for this?  Or would a defvar suffice?  (I don't have
strong feelings either way.)

Thanks,

--
Basil

Attachment: 0001-Remove-hardcoding-of-regexp-used-to-highlight-grep-m.patch
Description: 0001-Remove-hardcoding-of-regexp-used-to-highlight-grep-m.patch


reply via email to

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