Subject: Re: bug#49124: Wdired doesn't like re-search-forward/replace-match

From: Michael Heerdegen <[email-masked]>
Date: Sun, 20 Jun 2021 04:12:37 +0200

Eduardo Ochs <[email-masked]> writes:

> Is there a simple way to write a macro called, say,
> `wdired-with-narrow-to-filename' that would narrow the buffer to the
> editable portion of current line, evaluate some code, and on exit it
> would tell wdired to reread the filename in that line, knowing that it
> it may have been changed?

The answer to that question is much harder than to fix the underlying
problem in wdired (which should be quite easy).

AFAIU we just need a (save-restriction (widen) ...) wrapper for the code
of `wdired--before-change-fn' and `wdired--restore-properties'.  You can
try that in your instance, e.g. using an advice.

Regards,

Michael.