summaryrefslogtreecommitdiff
path: root/src/editfns.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-23 04:37:40 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-23 04:37:40 +0000
commitfb656a872fd2e261c2c80a102e6729e3db6b00cc (patch)
tree668f3e15cdcdcd34477371f6a52f5f0e0c1c3a1b /src/editfns.c
parent8a3afd6151d8bd6f182dcf3b1d54aa2a95509388 (diff)
downloademacs-fb656a872fd2e261c2c80a102e6729e3db6b00cc.tar.gz
(Fsave_current_buffer): New function.
(syms_of_editfns): defsubr it.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c
index ee126f06e16..dcef4bce269 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -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);
}
@@ -2515,6 +2530,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);