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

From: Juri Linkov <[email-masked]>
Date: Sun, 14 Jun 2020 01:50:49 +0300

> 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")))