(defun byte-compile-save-restriction (form)
(byte-compile-out 'byte-save-restriction 0)
(byte-compile-body-do-effect (cdr form))
- (byte-compile-out 'byte-unbind 1))
+ (byte-compile-out 'byte-unbind 2))
(defun byte-compile-save-current-buffer (form)
(byte-compile-out 'byte-save-current-buffer 0)
CASE (Bsave_restriction):
record_unwind_protect (save_restriction_restore,
save_restriction_save ());
+ record_unwind_protect (narrowing_locks_restore,
+ narrowing_locks_save ());
NEXT;
CASE (Bcatch): /* Obsolete since 25. */
{
record_unwind_protect (save_restriction_restore,
save_restriction_save ());
+ record_unwind_protect (narrowing_locks_restore,
+ narrowing_locks_save ());
}
static bool
/* Helper functions to save and restore the narrowing locks of the
current buffer in Fsave_restriction. */
-static Lisp_Object
+Lisp_Object
narrowing_locks_save (void)
{
Lisp_Object buf = Fcurrent_buffer ();
return Fcons (buf, Fcopy_sequence (locks));
}
-static void
+void
narrowing_locks_restore (Lisp_Object buf_and_saved_locks)
{
if (NILP (buf_and_saved_locks))
extern void save_excursion_restore (Lisp_Object, Lisp_Object);
extern Lisp_Object save_restriction_save (void);
extern void save_restriction_restore (Lisp_Object);
+extern Lisp_Object narrowing_locks_save (void);
+extern void narrowing_locks_restore (Lisp_Object);
extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool);
extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
ptrdiff_t, bool);