(narrow-to-page): With negative arg, move back one extra
[bpt/emacs.git] / src / editfns.c
index ee126f0..c2c0df9 100644 (file)
@@ -335,7 +335,22 @@ The state of activation of the mark is also restored.")
   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);
 }
@@ -780,7 +795,7 @@ If you want them to stand for years in this century, you must do that yourself."
       /* Restore TZ to previous value.  */
       newenv = environ;
       environ = oldenv;
-      free (newenv);
+      xfree (newenv);
 #ifdef LOCALTIME_CACHE
       tzset ();
 #endif
@@ -1144,9 +1159,8 @@ Any other markers at the point of insertion also end up after the text.")
   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.")
@@ -2515,6 +2529,7 @@ functions if all the text being accessed has this property.");
 /*  defsubr (&Smark); */
 /*  defsubr (&Sset_mark); */
   defsubr (&Ssave_excursion);
+  defsubr (&Ssave_current_buffer);
 
   defsubr (&Sbufsize);
   defsubr (&Spoint_max);