int count = specpdl_ptr - specpdl;
record_unwind_protect (save_excursion_restore, save_excursion_save ());
-
+
+ val = Fprogn (args);
+ return unbind_to (count, val);
+}
+
+DEFUN ("save-current-buffer", Fsave_current_buffer, Ssave_current_buffer, 0, UNEVALLED, 0,
+ "Save the current buffer; execute BODY; restore the current buffer.\n\
+Executes BODY just like `progn'.")
+ (args)
+ Lisp_Object args;
+{
+ register Lisp_Object val;
+ int count = specpdl_ptr - specpdl;
+
+ record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+
val = Fprogn (args);
return unbind_to (count, val);
}
/* Restore TZ to previous value. */
newenv = environ;
environ = oldenv;
- free (newenv);
+ xfree (newenv);
#ifdef LOCALTIME_CACHE
tzset ();
#endif
return Qnil;
}
-DEFUN ("insert-before-markers-and-inherit",
- Finsert_and_inherit_before_markers, Sinsert_and_inherit_before_markers,
- 0, MANY, 0,
+DEFUN ("insert-before-markers-and-inherit", Finsert_and_inherit_before_markers,
+ Sinsert_and_inherit_before_markers, 0, MANY, 0,
"Insert text at point, relocating markers and inheriting properties.\n\
Point moves forward so that it ends up after the inserted text.\n\
Any other markers at the point of insertion also end up after the text.")
/* defsubr (&Smark); */
/* defsubr (&Sset_mark); */
defsubr (&Ssave_excursion);
+ defsubr (&Ssave_current_buffer);
defsubr (&Sbufsize);
defsubr (&Spoint_max);