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#49534: 26.3; Isearch should support using filter predicates with empty search hits Date: Wed, 14 Jul 2021 02:21:54 +0300 Organization: LINKOV.NET Message-ID: <87zgup2419.fsf@mail.linkov.net> References: <87czrmrxfv.fsf@gnus.org> <87zguq6mof.fsf@mail.linkov.net> <874kcy6k4l.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7628"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 49534@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 14 01:23:16 2021 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 1m3RkC-0001iS-FQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Jul 2021 01:23:16 +0200 Original-Received: from localhost ([::1]:48990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3RkB-0002Cp-Gl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 19:23:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Rjy-0002Ap-Dv for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 19:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3Rjy-0006GB-6E for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 19:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3Rjx-0002NG-Ui for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 19:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jul 2021 23:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49534 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 49534-submit@debbugs.gnu.org id=B49534.16262185659103 (code B ref 49534); Tue, 13 Jul 2021 23:23:01 +0000 Original-Received: (at 49534) by debbugs.gnu.org; 13 Jul 2021 23:22:45 +0000 Original-Received: from localhost ([127.0.0.1]:42418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3Rjg-0002Ml-Sx for submit@debbugs.gnu.org; Tue, 13 Jul 2021 19:22:45 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:36021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3Rjc-0002MU-1g for 49534@debbugs.gnu.org; Tue, 13 Jul 2021 19:22:44 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 2B1831BF208; Tue, 13 Jul 2021 23:22:31 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Tue, 13 Jul 2021 18:48:39 -0400") 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:209903 Archived-At: >> This means that if isearch-filter-predicate does own matching, >> it will break later (= (match-beginning 0) (match-end 0)). >> What would be better: to remember its result in a let-bound variable, >> or to use save-match-data? Probably, save-match-data: > > Remembering the result in a var might be more efficient. > Also if `isearch-filter-predicate` clobbers the match data we have more > problems (unless it tells us to skip this match). > > But whichever choice we make I think the docstring of > `isearch-filter-predicate` should clarify what happens with the match > data (i.e. whether it needs to be careful not to clobber it or not). Then there is no need to remember the result in a var either since `isearch-filter-predicate` might want intentionally force forward-char as if the original match was empty. So the last change fixed a non-problem and now is reverted. Also I clarified the docstring of `isearch-filter-predicate`.