From 619d5af54ab1eb4d8f8e5971de65c8baf63f4732 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 9 Aug 2022 21:54:32 +0300 Subject: [PATCH] * lisp/replace.el (replace-highlight): Optimize for large buffers (bug#56815) 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/replace.el b/lisp/replace.el index cac0edf43ac..ae5c804be57 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -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 () -- 2.39.5