GNU bug report logs - #25751
Query replace lazy highlighting

Previous Next

Package: emacs;

Reported by: Antoine Levitt <antoine.levitt <at> gmail.com>

Date: Thu, 16 Feb 2017 13:18:01 UTC

Severity: minor

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Antoine Levitt <antoine.levitt <at> gmail.com>
Cc: 25751 <at> debbugs.gnu.org
Subject: bug#25751: Query replace lazy highlighting
Date: Thu, 16 Feb 2017 23:01:28 +0200
> When query-replacing and confirming, matches get unhighlighted, and then
> highlighted again, which is very distracting. E.g. open a file, M-% a ->
> a, y, other matches of a get unhighlighted then highlighted again.
>
> (setq lazy-highlight-initial-delay 0) (shouldn't it be default by the
> way, at least on graphical displays?) reduces the problem but does not
> eliminate it (it produces small flickers). There's
> lazy-highlight-cleanup, but that disables cleanup completely, which I
> don't want.
>
> Can't this be eliminated?

The reason why it works this way is because lazy-highlight is not yet
optimized to handle changes: it needs to dehighlight the replaced text,
and to add highlighting in the new replacing text after every replacement.
I see no simpler solution than to write a new function with a name like
‘isearch-lazy-highlight-update-in-region’ that given the region boundaries
of the last replacement will rehighlight matches in that region.




This bug report was last modified 8 years and 142 days ago.

Previous Next


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