From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#25751: Query replace lazy highlighting Date: Thu, 16 Feb 2017 23:01:28 +0200 Organization: LINKOV.NET Message-ID: <87wpcpx32v.fsf@localhost> References: <87mvdmxoig.fsf@lambda> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1487279177 16662 195.159.176.226 (16 Feb 2017 21:06:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2017 21:06:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) Cc: 25751@debbugs.gnu.org To: Antoine Levitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 16 22:06:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceTFi-0003uB-QW for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Feb 2017 22:06:10 +0100 Original-Received: from localhost ([::1]:50334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceTFo-0002fx-Kv for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Feb 2017 16:06:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceTFd-0002fE-7y for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2017 16:06:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceTFa-0002sM-Hd for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2017 16:06:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44475) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceTFa-0002sC-Ec for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2017 16:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ceTFa-0001q5-7O for bug-gnu-emacs@gnu.org; Thu, 16 Feb 2017 16:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Feb 2017 21:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25751 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25751-submit@debbugs.gnu.org id=B25751.14872791527044 (code B ref 25751); Thu, 16 Feb 2017 21:06:02 +0000 Original-Received: (at 25751) by debbugs.gnu.org; 16 Feb 2017 21:05:52 +0000 Original-Received: from localhost ([127.0.0.1]:42673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceTFP-0001pY-Ok for submit@debbugs.gnu.org; Thu, 16 Feb 2017 16:05:51 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:40115 helo=homiemail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceTFM-0001pI-N8 for 25751@debbugs.gnu.org; Thu, 16 Feb 2017 16:05:48 -0500 Original-Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 4C14F150074; Thu, 16 Feb 2017 13:05:48 -0800 (PST) Original-Received: from localhost.linkov.net (m83-191-240-183.cust.tele2.ee [83.191.240.183]) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPA id 739EE150069; Thu, 16 Feb 2017 13:05:47 -0800 (PST) In-Reply-To: <87mvdmxoig.fsf@lambda> (Antoine Levitt's message of "Thu, 16 Feb 2017 14:18:31 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129418 Archived-At: > When query-replacing and confirming, matches get unhighlighted, and the= n > 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 =E2=80=98isearch-lazy-highlight-update-in-region=E2=80=99 that given the = region boundaries of the last replacement will rehighlight matches in that region.