(Freplace_region_contents): Fix point preservation (bug#77607)

* src/editfns.c (Freplace_region_contents): Save excursion around
temporary restriction (bug#77607) and remove
`record_unwind_protect_excursion` made redundant by commit 40d8650d51.
This commit is contained in:
Stefan Monnier 2025-04-07 11:54:06 -04:00
parent fb5da5035a
commit ae5c608eca

View file

@ -1968,6 +1968,7 @@ a buffer or a string. But this is deprecated. */)
if (FUNCTIONP (source))
{
specpdl_ref count = SPECPDL_INDEX ();
record_unwind_protect_excursion ();
record_unwind_protect (save_restriction_restore,
save_restriction_save ());
Fnarrow_to_region (beg, end);
@ -2119,7 +2120,6 @@ a buffer or a string. But this is deprecated. */)
Fundo_boundary ();
bool modification_hooks_inhibited = false;
record_unwind_protect_excursion ();
/* We are going to make a lot of small modifications, and having the
modification hooks called for each of them will slow us down.