diff options
author | Eli Zaretskii <eliz@gnu.org> | 2020-10-07 12:12:06 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-10-07 12:12:06 +0300 |
commit | 7be18bbfe1f51f2828e868900b83b013faeb6db6 (patch) | |
tree | 1fc52bdb320c3ff29fef4d398bdb8b1752ba6caa /doc/emacs | |
parent | 466db12df04c2bbc289769094f45933819f03f6c (diff) | |
download | emacs-7be18bbfe1f51f2828e868900b83b013faeb6db6.tar.gz emacs-7be18bbfe1f51f2828e868900b83b013faeb6db6.tar.bz2 emacs-7be18bbfe1f51f2828e868900b83b013faeb6db6.zip |
Improve documentation of 'isearch-group-N' faces
* etc/NEWS:
* doc/emacs/search.texi (Search Customizations): Improve and
clarify the wording of the 'isearch-group-N' faces description.
* lisp/isearch.el (search-highlight-submatches): Doc fix.
Diffstat (limited to 'doc/emacs')
-rw-r--r-- | doc/emacs/search.texi | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index d25e35635e9..2169a4120be 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1984,13 +1984,21 @@ 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-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-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. +highlighted with distinct faces. By default, two distinct faces are +defined, named @code{isearch-group-1} and @code{isearch-group-2}. +With these two faces, odd-numbered subexpressions will be highlighted +using the @code{isearch-group-1} face and even-numbered subexpressions +will be highlighted using the @code{isearch-group-2} face. For +instance, when searching for @samp{foo-\([0-9]+\)\([a-z]+\)}, the part +matched by @samp{[0-9]+} will be highlighted with the +@code{isearch-group-1} face, and the part matched by @samp{[a-z]+} +will be highlighted using @code{isearch-group-2}. If you define +additional faces using the same numbering scheme, i.e.@: +@code{isearch-group-3}, @code{isearch-group-4}, @dots{}, then the face +@code{isearch-group-@var{M}} will be used to highlight the @var{M}'th, +@code{@var{N}+@var{M}}'th, @code{2@var{N}+@var{M}}'th, @dots{} +subexpressions, where @var{N} is the total number of faces of the form +@code{isearch-group-@var{M}}. @cindex lazy highlighting customizations @vindex isearch-lazy-highlight |