Subject: bug#6227: Color isearch regexp submatches differently

From: Drew Adams <[email-masked]>
Date: Sat, 19 Sep 2020 15:19:30 -0700 (PDT)

> I guess we should add a few more faces before applying?
> 
> Anybody else got any comments on this?

Haven't tried the patch.  But Isearch+ does this.
It uses 8 faces, for the first 8 regexp levels
(groups).

(The code could be go further, repeating those 8
faces if needed for more groups, but I haven't found
that that's needed.)

For lazy-highlighting, the odd groups are highlighted
differently from the even groups.  The odd groups use
face `isearchp-lazy-odd-regexp-groups'.  That simple
lazy highlighting actually helps quite a bit, I find.  

There is also a user option for whether to highlight
groups: `isearchp-highlight-regexp-group-levels-flag'.
And a toggle command for that option: `M-s h R'
(prefix `M-s' is for all Isearch stuff, `h' is for
highlighting, and `R' is for regexp groups).