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: Sun, 27 Mar 2022 10:46:01 +0300 Organization: LINKOV.NET Message-ID: <86y20vu9c6.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> <86zglrl4gq.fsf@mail.linkov.net> <87ee32yk7v.fsf@gmail.com> <861qz1zqfb.fsf@mail.linkov.net> <875yod1wyb.fsf@gmail.com> <86mtho5y56.fsf@mail.linkov.net> <87sfrgz979.fsf@gmail.com> <861qz0475w.fsf@mail.linkov.net> <87sfrd2cbb.fsf@gmail.com> <86fsnc4fvm.fsf@mail.linkov.net> <878rsz6um2.fsf@gmail.com> <86ils2mmbe.fsf@mail.linkov.net> <87v8w2qsee.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="28352"; 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 Sun Mar 27 09:50:42 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 1nYNfe-0007FD-Kd for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Mar 2022 09:50:42 +0200 Original-Received: from localhost ([::1]:52420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYNfd-00078I-A1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Mar 2022 03:50:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYNf0-00077W-QV for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2022 03:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYNf0-00055r-I7 for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2022 03:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nYNf0-0004Kc-Dj for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2022 03:50: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: Sun, 27 Mar 2022 07:50: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.164836737516610 (code B ref 53126); Sun, 27 Mar 2022 07:50:02 +0000 Original-Received: (at 53126) by debbugs.gnu.org; 27 Mar 2022 07:49:35 +0000 Original-Received: from localhost ([127.0.0.1]:55212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYNeZ-0004Jq-0L for submit@debbugs.gnu.org; Sun, 27 Mar 2022 03:49:35 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:58415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYNeW-0004Jb-C8 for 53126@debbugs.gnu.org; Sun, 27 Mar 2022 03:49:34 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id A7CEF100004; Sun, 27 Mar 2022 07:49:24 +0000 (UTC) In-Reply-To: <87v8w2qsee.fsf@gmail.com> (Augusto Stoffel's message of "Fri, 25 Mar 2022 10:43:21 +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:228990 Archived-At: > Lazy highlight is controlled by lots of variables. These variables need > to be set for the duration of the minibuffer session that reads the > replacement strings. If we move this to a separate function, we can't > use 'let' anymore, so we basically need to reinvent the dynamic scoping > feature of Elisp (i.e., save the current values, set the variables to > new values, then restore the old values in some hook). And an even ugly > workaround would be needed to replace the necessary condition-case. Or > do I misunderstand you altogether? Do you think a macro could help to make this function short again? Then when you would want to add highlighting to the minibuffer reading the TO part of replacement too or to other minibuffers, it would be easy to just add a single line with that macro.