Fix blunder in labeled_narrow_to_region
authorGregory Heytings <gregory@heytings.org>
Thu, 11 Jan 2024 23:38:22 +0000 (23:38 +0000)
committerGregory Heytings <gregory@heytings.org>
Sun, 14 Jan 2024 21:59:21 +0000 (21:59 +0000)
* 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.

src/editfns.c

index 063dfc6d131061e69a53a97c5994958bbd73ce54..6ddee0840c2eafa9c68d97d2ce9136c3ce4b8c82 100644 (file)
@@ -2870,9 +2870,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, "",