]> git.eshelyaron.com Git - emacs.git/commitdiff
(Freplace_region_contents): Fix point preservation (bug#77607)
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 7 Apr 2025 15:54:06 +0000 (11:54 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 8 Apr 2025 05:49:57 +0000 (07:49 +0200)
* src/editfns.c (Freplace_region_contents): Save excursion around
temporary restriction (bug#77607) and remove
`record_unwind_protect_excursion` made redundant by commit 40d8650d5177.

(cherry picked from commit ae5c608eca636ad1c5c76294d81f16a16d2ec3b5)

src/editfns.c

index 9590b49dc258e35be062a8c3a8a302397da065a9..669d3cdb140f49b1ae7be81a32ce80f7948838f8 100644 (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.