diff options
author | Juri Linkov <juri@linkov.net> | 2020-10-06 23:14:26 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2020-10-06 23:14:26 +0300 |
commit | 46aa145d3906d21b4eb0e088c6325967c1579f3d (patch) | |
tree | 6a644fdff245b2991ec54191b4d52716f51a8f0a /doc/emacs/search.texi | |
parent | ec705a6c3485b508b64981bd5a7fd3a60611357d (diff) | |
download | emacs-46aa145d3906d21b4eb0e088c6325967c1579f3d.tar.gz |
Add match-data to isearch state and repeat faces to highlight group matches
* lisp/isearch.el (isearch-match-data): New variable.
(isearch-mode): Set isearch-match-data to nil.
(isearch-update): Call isearch-highlight with isearch-match-data.
(isearch--state): Add isearch-match-data.
(isearch--set-state): Restore isearch-match-data.
(with-isearch-suspended): Preserve isearch-match-data.
(isearch-search): Set isearch-match-data to integers.
(isearch-group-1): Rename from isearch-group-odd and adjust colors.
(isearch-group-2): Rename from isearch-group-even and adjust colors.
(isearch-highlight): Add optional arg 'match-data'.
Rewrite search-highlight-submatches part to recycle faces.
* doc/emacs/search.texi (Search Customizations): Amend the
documentation for isearch-group faces.
(bug#6227, bug#43702)
Diffstat (limited to 'doc/emacs/search.texi')
-rw-r--r-- | doc/emacs/search.texi | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index d982a9e8787..d25e35635e9 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1984,11 +1984,13 @@ the @code{search-highlight-submatches} variable. If this variable's value is @code{nil}, no special highlighting is done, but if the value is non-@code{nil}, text that matches @samp{\( @dots{} \)} constructs (a.k.a.@: ``subexpressions'') in the regular expression will be -highlighted with distinct faces, named @code{isearch-group-odd} -for the odd group matches, and @code{isearch-group-even} -for the even group matches. For instance, when searching for +highlighted with distinct faces, named @code{isearch-group-1} +and @code{isearch-group-2}. For instance, when searching for @samp{foo-\([0-9]+\)}, the part matched by @samp{[0-9]+} will be -highlighted with the @code{isearch-group-odd} face. +highlighted with the @code{isearch-group-1} face. When there are +more matches than faces, then faces are recycled from beginning, +so the @code{isearch-group-1} face is used for the third match again. +You can define more faces using the same numbering scheme. @cindex lazy highlighting customizations @vindex isearch-lazy-highlight |