From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc. Date: Thu, 17 Mar 2022 22:43:20 +0200 Organization: LINKOV.NET Message-ID: <86mtho2sg9.fsf@mail.linkov.net> References: <87sftyweb2.fsf@gmail.com> <861r1iyrvw.fsf@mail.linkov.net> <87zgo6owaf.fsf@gmail.com> <86k0f9xnrn.fsf@mail.linkov.net> <87tuedp6pl.fsf@gmail.com> <861r1g7n3b.fsf@mail.linkov.net> <87o84jcx5x.fsf@gmail.com> <8635lvif0r.fsf@mail.linkov.net> <87mtidip1w.fsf@gmail.com> <86sfrjia5u.fsf@mail.linkov.net> <87ilseyks7.fsf@gmail.com> <868rt9wwji.fsf@mail.linkov.net> <871qz11w82.fsf@gmail.com> <86ilsc7e31.fsf@mail.linkov.net> <87o824z7ka.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25723"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 53126@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 17 22:16:34 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nUxU1-0006V0-N5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Mar 2022 22:16:33 +0100 Original-Received: from localhost ([::1]:56892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUxU0-0002kP-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Mar 2022 17:16:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUxTW-0001t1-Or for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2022 17:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUxTW-0007AP-Fj for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2022 17:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nUxTW-0005z9-BY for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2022 17:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Mar 2022 21:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53126-submit@debbugs.gnu.org id=B53126.164755173822954 (code B ref 53126); Thu, 17 Mar 2022 21:16:02 +0000 Original-Received: (at 53126) by debbugs.gnu.org; 17 Mar 2022 21:15:38 +0000 Original-Received: from localhost ([127.0.0.1]:55368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxT8-0005yA-8u for submit@debbugs.gnu.org; Thu, 17 Mar 2022 17:15:38 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:48153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUxT6-0005xk-9R for 53126@debbugs.gnu.org; Thu, 17 Mar 2022 17:15:36 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 0D42D240003; Thu, 17 Mar 2022 21:15:28 +0000 (UTC) In-Reply-To: <87o824z7ka.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 17 Mar 2022 20:45:57 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228514 Archived-At: > On Thu, 17 Mar 2022 at 19:05, Juri Linkov wrote: > >>>> When I tried your latest patch, it still flashes when it starts >>>> the perform-replace loop. >>> >>> Does it always happen for you? I see this occasionally, and as far as I >>> can tell it's random. >> >> It happens every time when starting perform-replace from isearch. > > Interesting, I can't see thing flash at that particular place. But I've > replaced the unwind-protect by a more fine-grained condition-case. Let > me know if it helps. > >> The biggest hunk in your patch are changes in query-replace-read-args >> starting from 'condition-case error'. Would it be possible to simplify >> this part? Maybe by some refactoring? > > The only refactoring opportunity I see it to define > > (defun replace-regexp-function (delimited-flag) > (or replace-regexp-function > delimited-flag > (and replace-char-fold > (not regexp-flag) > #'char-fold-to-regexp))) > > which can be used in 3 places. Should I do that? > > Otherwise, I dont' see much room for improvement. There are a lot of > moving parts there, so to me things already turned out surprisingly > short. I meant a function that translates arguments of query-replace/perform-replace to search parameters. They are currently used in replace-search and replace-highlight. But maybe could be reused by query-replace-read-args?