GNU bug report logs - #56815
29.0.50; Isearch lazy-highlight highlights too much when truncate-lines is in effect

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Thu, 28 Jul 2022 17:30:01 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 56815 <at> debbugs.gnu.org
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
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))))
```




This bug report was last modified 2 years and 297 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.