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

From: Simon Lang <[email-masked]>
Date: Sun, 14 Jun 2020 10:12:03 +0100

> Am 13.06.2020 um 23:59 schrieb Juri Linkov <[email-masked]>:
> 
> 
>> 
>> Maybe also a way to easily register new search tools? Otherwise one might
>> be locked into the available options again - and if there is a new tool the
>> interface might be not that stable, so there is the danger that it breaks
>> until there is a new emacs release.
> 
> No problem, you can even dynamically add an option available only
> when a grep program is installed:
> 
> (defcustom grep-program nil
>  "The default grep program for `grep-command' and `grep-find-command'.
> This variable's value takes effect when `grep-compute-defaults' is called."
>  :type `(choice (const :tag "GNU grep" (purecopy "grep"))
>                 ,@(if (executable-find "rg") '((const :tag "ripgrep" "rg")))
>                 (string :tag "Other grep program")
>                 (const :tag "Not Set" nil))
>  :version "28.1")
> 
> Or for a completely new tool:
> 
> (nconc (get 'grep-program 'custom-type) '((const :tag "ripgrep" "rg")))

Maybe still fine to merge my patch now and look at this later? One would not contradict the other, I would think? 

@Eli: sorry I hope my revised patch was not buried below this other discussion now. 

Thank you! 

Simon