Variable: query-replace-highlight-submatches

query-replace-highlight-submatches is a customizable variable defined in replace.el.gz.

Value

t

Documentation

Whether to highlight regexp subexpressions during query replacement.

The faces used to do the highlights are named isearch-group-1, isearch-group-2, etc. (By default, only these 2 are defined.) When there are more matches than faces, then faces are reused from the beginning, in a cyclical manner, so the isearch-group-1 face is isreused for the third match. If you want to use more distinctive colors, you can define more of these faces using the same numbering scheme.

This variable was added, or its default value changed, in Emacs 28.1.

View in manual

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/replace.el.gz
(defcustom query-replace-highlight-submatches t
  "Whether to highlight regexp subexpressions during query replacement.
The faces used to do the highlights are named `isearch-group-1',
`isearch-group-2', etc.  (By default, only these 2 are defined.)
When there are more matches than faces, then faces are reused from the
beginning, in a cyclical manner, so the `isearch-group-1' face is
isreused for the third match.  If you want to use more distinctive colors,
you can define more of these faces using the same numbering scheme."
  :type 'boolean
  :group 'matching
  :version "28.1")