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: Wed, 22 Feb 2017 01:22:30 +0200 Organization: LINKOV.NET Message-ID: <87mvdf164p.fsf@localhost> References: <87mvdmxoig.fsf@lambda> <87wpcpx32v.fsf@localhost> <83d1ehxqzd.fsf@gnu.org> <87poig2zwg.fsf@localhost> <83mvdjrk6j.fsf@gnu.org> <87h93rcffj.fsf@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1487719460 12690 195.159.176.226 (21 Feb 2017 23:24:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2017 23:24:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) Cc: 25751-done@debbugs.gnu.org, antoine.levitt@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 22 00:24:12 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 1cgJmz-0002Km-LM for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Feb 2017 00:24:09 +0100 Original-Received: from localhost ([::1]:49070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgJn5-0002Hz-BC for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Feb 2017 18:24:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgJmw-0002GX-BX for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2017 18:24:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgJms-0008F1-DY for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2017 18:24:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgJms-0008Et-9q for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2017 18:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cgJms-00032Q-48 for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2017 18:24:02 -0500 Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2017 23:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 25751 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 25751@debbugs.gnu.org, juri@linkov.net, antoine.levitt@gmail.com Original-Received: via spool by 25751-done@debbugs.gnu.org id=D25751.148771938311594 (code D ref 25751); Tue, 21 Feb 2017 23:24:01 +0000 Original-Received: (at 25751-done) by debbugs.gnu.org; 21 Feb 2017 23:23:03 +0000 Original-Received: from localhost ([127.0.0.1]:49399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgJlv-00030w-Iu for submit@debbugs.gnu.org; Tue, 21 Feb 2017 18:23:03 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:49783 helo=homiemail-a17.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgJlu-00030Z-ED for 25751-done@debbugs.gnu.org; Tue, 21 Feb 2017 18:23:02 -0500 Original-Received: from homiemail-a17.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTP id 45A112B206D; Tue, 21 Feb 2017 15:22:57 -0800 (PST) Original-Received: from localhost.linkov.net (m212-107-59-228.cust.tele2.ee [212.107.59.228]) (Authenticated sender: jurta@jurta.org) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPA id 29C642B206A; Tue, 21 Feb 2017 15:22:55 -0800 (PST) In-Reply-To: <87h93rcffj.fsf@localhost> (Juri Linkov's message of "Sun, 19 Feb 2017 01:17:04 +0200") 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:129639 Archived-At: >>> > I think the problem is not that we remove the highlight and add it >>> > anew, the problem is that there's a redisplay cycle in between the >>> > removal and the following addition. The fact that setting >>> > lazy-highlight-initial-delay alleviates the problem to some extent, >>> > but still leaves the flicker tells me that there's a call to sit-for >>> > or some such somewhere in the code that processes replacements, and >>> > the removal and addition of the highlight are on two different sides >>> > of that sit-for call. One possible solution would be to remove the >>> > highlight and add it without triggering redisplay, then I'd expect the >>> > flicker to go away. >>> > >>> > Does this make sense? >>> >>> This feature is called _lazy_ highlighting where _lazy_ implies that it's >>> intended to highlight matches much later after a lot of redisplay cycles. >> >> You could still leave the "lazy" part, if you both remove and re-add >> the overlays after the idle delay. IOW, the important thing is not to >> have redisplay between removal and addition of the highlight. > > That's an option too, and here is the tested patch (it sets > lazy-highlight-max-at-a-time to nil to avoid redisplay between > lazy iterations): Installed and closed.