]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/replace.el (replace-highlight): Optimize for large buffers (bug#56815)
authorJuri Linkov <juri@linkov.net>
Tue, 9 Aug 2022 18:54:32 +0000 (21:54 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 9 Aug 2022 18:54:32 +0000 (21:54 +0300)
Let-bind isearch-lazy-count and lazy-highlight-buffer to nil to avoid
revisiting all matches in the whole buffer after every replacement.

lisp/replace.el

index cac0edf43acfbd68f6b13382be959c5a063a0d39..ae5c804be57c02ced47d8c6e6f0352263c393daf 100644 (file)
@@ -2744,7 +2744,9 @@ to a regexp that is actually used for the search.")
            (isearch-case-fold-search case-fold)
            (isearch-forward (not backward))
            (isearch-other-end match-beg)
-           (isearch-error nil))
+           (isearch-error nil)
+           (isearch-lazy-count nil)
+           (lazy-highlight-buffer nil))
        (isearch-lazy-highlight-new-loop range-beg range-end))))
 
 (defun replace-dehighlight ()