]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix blunder in labeled_narrow_to_region
authorGregory Heytings <gregory@heytings.org>
Thu, 11 Jan 2024 23:38:22 +0000 (23:38 +0000)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Jan 2024 16:29:30 +0000 (17:29 +0100)
* src/editfns.c (labeled_narrow_to_region): Record point before,
instead of after, calling narrow-to-region; otherwise point may
already have been changed.  Fixes bug#66764.

(cherry picked from commit 5bb5590dec95e813ed120b3f09734451b4ebb18f)

src/editfns.c

index f3b3cfb72432a2da88c77c02371b365a6464a562..7b84f71f4a80e7fdb2bc6e8550d9d7aa6b874ca8 100644 (file)
@@ -2877,9 +2877,9 @@ void
 labeled_narrow_to_region (Lisp_Object begv, Lisp_Object zv,
                          Lisp_Object label)
 {
-  Finternal__labeled_narrow_to_region (begv, zv, label);
   record_unwind_protect (restore_point_unwind, Fpoint_marker ());
   record_unwind_protect (unwind_labeled_narrow_to_region, label);
+  Finternal__labeled_narrow_to_region (begv, zv, label);
 }
 
 DEFUN ("widen", Fwiden, Swiden, 0, 0, "",