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.devel Subject: Re: master 2b3f3d421a: Make minibuffer lazy highlight setup buffer-local where appropriate Date: Wed, 18 May 2022 21:59:04 +0300 Organization: LINKOV.NET Message-ID: <86ee0qd5sf.fsf@mail.linkov.net> References: <165264034407.21518.7194358780844409479@vcs2.savannah.gnu.org> <20220515184546.6304CC01683@vcs2.savannah.gnu.org> <87lev2h590.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="17977"; 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: Stefan Monnier , emacs-devel@gnu.org To: Augusto Stoffel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 18 21:03:40 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nrOxP-0004Vd-SP for ged-emacs-devel@m.gmane-mx.org; Wed, 18 May 2022 21:03:39 +0200 Original-Received: from localhost ([::1]:37738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrOxO-0006Ih-Ex for ged-emacs-devel@m.gmane-mx.org; Wed, 18 May 2022 15:03:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrOwF-0005PQ-8H for emacs-devel@gnu.org; Wed, 18 May 2022 15:02:27 -0400 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:47473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrOwD-0004hd-Ew for emacs-devel@gnu.org; Wed, 18 May 2022 15:02:26 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id EE21E1C0006; Wed, 18 May 2022 19:02:18 +0000 (UTC) In-Reply-To: <87lev2h590.fsf@gmail.com> (Augusto Stoffel's message of "Sun, 15 May 2022 23:10:03 +0200") Received-SPF: pass client-ip=2001:4b98:dc4:8::225; envelope-from=juri@linkov.net; helo=relay5-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289933 Archived-At: >> `add-function` is modeled after `add-hook`, so the above >> `make-local-variable` would be better replaced with >> >> (add-function :after-while (local 'isearch-filter-predicate) filter) >> >> [ Of course, that's pure theory. You'd better test it first. ] > > Yes, I guess that's the right way to approach this. The attached patch > implements it. Thanks, pushed. > Now, I had tried it earlier and noticed something looked fishy. Now I > can reproduce the problem: > > 1. With an active region, call C-M-% > 2. Switch from the minibuffer back to the original buffer > 3. Call keyboard-escape-quit (maybe twice) to quit the minibuffer > prompt. > > Then the buffer-local value of `isearch-filter-predicate' is not cleaned > up. Is it by any chance intentional that minibuffer-exit-hook doesn't > run in this case? Indeed, a buffer-local minibuffer-exit-hook is not called when the minibuffer is exited outside of the minibuffer. This problem exists for all existing uses of buffer-local minibuffer-exit-hook. For example, in 'string-rectangle': 1. activate a rectangular region 2. type 'C-x r t' 3. enter a string in the minibuffer 4. switch to the original buffer 5. call keyboard-escape-quit twice The temporary review content of the rectangle is not erased by rectangle--string-erase-preview from minibuffer-exit-hook.