From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25751: Query replace lazy highlighting Date: Sat, 18 Feb 2017 10:13:08 +0200 Message-ID: <83mvdjrk6j.fsf@gnu.org> References: <87mvdmxoig.fsf@lambda> <87wpcpx32v.fsf@localhost> <83d1ehxqzd.fsf@gnu.org> <87poig2zwg.fsf@localhost> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1487405598 17196 195.159.176.226 (18 Feb 2017 08:13:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2017 08:13:18 +0000 (UTC) Cc: 25751@debbugs.gnu.org, antoine.levitt@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 18 09:13:13 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 1cf08m-0003s4-TI for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Feb 2017 09:13:13 +0100 Original-Received: from localhost ([::1]:57539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cf08s-0007DA-Fz for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Feb 2017 03:13:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cf08h-0007BF-FV for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2017 03:13:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cf08c-0005Rq-RW for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2017 03:13:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cf08c-0005Ri-Nd for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2017 03:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cf08c-000229-Hs for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2017 03:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2017 08:13: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.14874055717800 (code B ref 25751); Sat, 18 Feb 2017 08:13:02 +0000 Original-Received: (at 25751) by debbugs.gnu.org; 18 Feb 2017 08:12:51 +0000 Original-Received: from localhost ([127.0.0.1]:44114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf08Q-00021k-Pg for submit@debbugs.gnu.org; Sat, 18 Feb 2017 03:12:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf08O-00021X-KY for 25751@debbugs.gnu.org; Sat, 18 Feb 2017 03:12:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cf08E-0005MP-V5 for 25751@debbugs.gnu.org; Sat, 18 Feb 2017 03:12:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cf08E-0005ML-SY; Sat, 18 Feb 2017 03:12:38 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4543 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cf08D-0007Up-S1; Sat, 18 Feb 2017 03:12:38 -0500 In-reply-to: <87poig2zwg.fsf@localhost> (message from Juri Linkov on Sat, 18 Feb 2017 00:52:47 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:129479 Archived-At: > From: Juri Linkov > Cc: antoine.levitt@gmail.com, 25751@debbugs.gnu.org > Date: Sat, 18 Feb 2017 00:52:47 +0200 > > > 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.