# HG changeset patch # User Gerd Moellmann # Date 976886541 0 # Node ID dab8fe8d55f4785d97769ac270a2920217519de0 # Parent d5285e74768f52eae0ff5cced8263c3e5c58e386 (isearch-lazy-highlight-max): New user-option. (isearch-lazy-highlight-update): Don't highlight more than isearch-lazy-highlight-max matches. diff -r d5285e74768f -r dab8fe8d55f4 lisp/isearch.el --- a/lisp/isearch.el Fri Dec 15 13:01:30 2000 +0000 +++ b/lisp/isearch.el Fri Dec 15 13:22:21 2000 +0000 @@ -1871,6 +1871,12 @@ :type 'number :group 'isearch-lazy-highlight) +(defcustom isearch-lazy-highlight-max 20 + "*Maximum number of matches to highlight." + :type '(choice (const :tag "All" nil) + (integer :tag "Some")) + :group 'isearch-lazy-highlight) + (defgroup isearch-faces nil "Lazy highlighting feature for incremental search." :version "21.1" @@ -1961,7 +1967,10 @@ (defun isearch-lazy-highlight-update () "Find and highlight the next match in the lazy highlighting loop." - (when (not isearch-invalid-regexp) + (when (and (not isearch-invalid-regexp) + (or (null isearch-lazy-highlight-max) + (< (length isearch-lazy-highlight-overlays) + isearch-lazy-highlight-max))) (save-excursion (save-match-data (goto-char (if isearch-forward