summaryrefslogtreecommitdiff
path: root/doc/emacs
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2020-09-20 15:46:19 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-20 15:46:19 +0200
commit09e109851b94d826424a073b56700a46bdbf4b5f (patch)
tree5b07566c7525834e94e8b5c79f12a52ec110e7c6 /doc/emacs
parentf8d8d28bc67cc69efd9a5d9d9bf3aba43219e0e3 (diff)
downloademacs-09e109851b94d826424a073b56700a46bdbf4b5f.tar.gz
emacs-09e109851b94d826424a073b56700a46bdbf4b5f.tar.bz2
emacs-09e109851b94d826424a073b56700a46bdbf4b5f.zip
Highlight regexp sub-expressions
* doc/emacs/search.texi (Search Customizations): Document it. * lisp/isearch.el (search-highlight-submatches): New variable. (isearch-group-1, isearch-group-2, isearch-group-3) (isearch-group-4, isearch-group-5): New faces. (isearch-highlight): Use them. (isearch-dehighlight): Ditto (bug#6227).
Diffstat (limited to 'doc/emacs')
-rw-r--r--doc/emacs/search.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 2e094f3ad92..9716d87504e 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -1977,6 +1977,16 @@ performs case folding and lax-whitespace matching.
using the @code{isearch} face. This highlighting can be disabled by
setting the variable @code{search-highlight} to @code{nil}.
+@vindex search-highlight-submatches
+ When searching for regular expressions (with @kbd{C-u C-s}, for
+instance), subexpressions receive special highlighting depending on
+the @code{search-highlight-submatches} variable. If this variable is
+zero, no special highlighting is done, but if this is larger than
+zero, subexpressions will be matched with
+@code{isearch-group-}@samp{X} faces. 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.
+
@cindex lazy highlighting customizations
@vindex isearch-lazy-highlight
@cindex @code{lazy-highlight} face