From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriele Nicolardi Newsgroups: gmane.emacs.bugs Subject: bug#69542: Feature request: making occur obey isearch-filter-predicate Date: Sat, 9 Mar 2024 00:09:58 +0100 Message-ID: <1a877643-e543-433d-8ab2-acbe914d17a6@medialab.sissa.it> References: <6071eb9a-fa15-45fb-9917-7a35c7556680@medialab.sissa.it> <86msrdnjdn.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------HDa1MdMkPTE8nCKCJjHCTz5J" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13609"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69542@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 09 00:11:00 2024 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 1rijMi-0003Ml-1X for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Mar 2024 00:11:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rijMJ-0007lj-2x; Fri, 08 Mar 2024 18:10:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rijME-0007jb-06 for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 18:10:30 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rijMD-0001Y8-NG for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 18:10:29 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rijMj-0004yK-Pv for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 18:11:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gabriele Nicolardi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2024 23:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69542 X-GNU-PR-Package: emacs Original-Received: via spool by 69542-submit@debbugs.gnu.org id=B69542.170993944219083 (code B ref 69542); Fri, 08 Mar 2024 23:11:01 +0000 Original-Received: (at 69542) by debbugs.gnu.org; 8 Mar 2024 23:10:42 +0000 Original-Received: from localhost ([127.0.0.1]:59931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rijMQ-0004xh-9C for submit@debbugs.gnu.org; Fri, 08 Mar 2024 18:10:42 -0500 Original-Received: from smtp03.cbsolt.net ([185.97.217.42]:45400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rijMM-0004xP-Ml for 69542@debbugs.gnu.org; Fri, 08 Mar 2024 18:10:40 -0500 Original-Received: from [10.0.2.15] (host-79-45-241-136.retail.telecomitalia.it [79.45.241.136]) by smtp03.cbsolt.net (Postfix) with ESMTPSA id 4Ts21z4gCHz3wc3; Sat, 9 Mar 2024 00:09:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1709939400; bh=cEgMOQzs5S/8aW/7urrmjCTVRVyPNKWBBJCYTunfkWo=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=V7oV+bl8mwuqkKWnq86fdAUyIu4XzKnPmlVHzjJhlnR9EGvtNP3MuFWEugFy6RwLG tsVj+CfOhHyf+5XnlsZcn78SHTiSgi4O/9TTzP5xrPjlGrAO5ZN1odT27/tybKYD5k VOXMqGg1+tGuXAcBkvJ91kgj7Tgh/5l0xBnxdXgw= Content-Language: en-US In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281280 Archived-At: This is a multi-part message in MIME format. --------------HDa1MdMkPTE8nCKCJjHCTz5J Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Il 05/03/24 18:11, Gabriele Nicolardi ha scritto: >> I think duplicating the whole body of functions is not better >> than using advice. > > Until yesterday, I had no idea how to advise a function. > > I don't know if advicing a function to advice a function inside it is > a good idea but it seem to work (I need more tests). > > Now I discovered how to build these functions I could be fine with my > modified ones, but making this feature avaible (maybe not default) in > the original functions could be a better idea > I found that advicing the |occur| and |how-many| function, overriding the |re-search-forward| function with my modified version of it (sensitive to |isearch-filter-predicate|) it’s not good at all. That because some predicates, like e.g. |texmathp| provided by AUCTeX, use |re-search-forward| too. > . > >> An alternative would be to add a new variable >> 're-search-forward-function' and then to use it like >> '(funcall re-search-forward-function)'. > > The idea of a new function seems good to me. > > ​ --------------HDa1MdMkPTE8nCKCJjHCTz5J Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Il 05/03/24 18:11, Gabriele Nicolardi ha scritto:

I think duplicating the whole body of functions is not better
than using advice. 

Until yesterday, I had no idea how to advise a function.

I don't know if advicing a function to advice a function inside it is a good idea but it seem to work (I need more tests).

Now I discovered how to build these functions I could be fine with my modified ones, but making this feature avaible (maybe not default) in the original functions could be a better idea

I found that advicing the occur and how-many function, overriding the re-search-forward function with my modified version of it (sensitive to isearch-filter-predicate) it’s not good at all.

That because some predicates, like e.g. texmathp provided by AUCTeX, use re-search-forward too.

.

 An alternative would be to add a new variable
're-search-forward-function' and then to use it like
'(funcall re-search-forward-function)'.

The idea of a new function seems good to me.


--------------HDa1MdMkPTE8nCKCJjHCTz5J--