bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when trun


From: Juri Linkov
Subject: bug#56815: 29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect
Date: Mon, 08 Aug 2022 20:20:41 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

While waiting when buffer-local current_buffer->long_line_optimizations_p
will be exposed to Lisp, I noticed another need for lazy-highlight optimization:
in large buffers (but without long lines) some customization makes replacement
too slow when lazy-highlight tries to rehighlight the whole buffer
after every replacement.  For query-replace it should be enough to
highlight matches only on the displayed screen, therefore this patch
fixes the problem:

```
diff --git a/lisp/replace.el b/lisp/replace.el
index cac0edf43a..9a1f6f22e0 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2744,7 +2750,9 @@ replace-highlight
            (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))))
```





reply via email to

[Prev in Thread] Current Thread [Next in Thread]