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.