Subject: Re: bug#69573: Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)

From: Michael Heerdegen <[email-masked]>
Date: Sat, 09 Mar 2024 05:30:24 +0100

Gabriele Nicolardi <[email-masked]> writes:

> Is my code wrong in some way?

I don't know.

> I mean that I think that
>
> (defalias 're-search-forward-ifpmod (symbol-function 're-search-forward) "Copy of
> `re-search-forward' function (to be) adviced to obey to `isearch-filter-predicate'")
>
> should create a COPY, not an ALIAS, of the `re-search-forward`
> function indipendent of the original function.

Stefan, can you help maybe?  Gabriele then does this:

#+begin_src emacs-lisp
(advice-add 're-search-forward-ifpmod
            :around
            #'make-search-sensitive-to-ifpmod-advice)
#+end_src

and we have found that this causes weird errors because at least some
definitions, like `forward-paragraph', call `re-search-forward-ifpmod'
afterwards.  This seems to happen only when using a native compiled
Emacs, and the effect disappears when loading the source - paragraphs.el
in this case.  Is this normal?

Michael