diff options
| author | Richard M. Stallman | 1996-09-23 04:37:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-23 04:37:40 +0000 |
| commit | 4bc8c7d2f4cbf39578265d672b215961f052d167 (patch) | |
| tree | f43572d1db06c2b41d7a18f2f423c1aa10846c03 /src | |
| parent | 111e5992df9de83e437821faffe3c63dcd29b8f4 (diff) | |
| download | emacs-4bc8c7d2f4cbf39578265d672b215961f052d167.tar.gz emacs-4bc8c7d2f4cbf39578265d672b215961f052d167.zip | |
(Fsave_current_buffer): New function.
(syms_of_editfns): defsubr it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 18 |
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.") | |||
| 335 | int count = specpdl_ptr - specpdl; | 335 | int count = specpdl_ptr - specpdl; |
| 336 | 336 | ||
| 337 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 337 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 338 | 338 | ||
| 339 | val = Fprogn (args); | ||
| 340 | return unbind_to (count, val); | ||
| 341 | } | ||
| 342 | |||
| 343 | DEFUN ("save-current-buffer", Fsave_current_buffer, Ssave_current_buffer, 0, UNEVALLED, 0, | ||
| 344 | "Save the current buffer; execute BODY; restore the current buffer.\n\ | ||
| 345 | Executes BODY just like `progn'.") | ||
| 346 | (args) | ||
| 347 | Lisp_Object args; | ||
| 348 | { | ||
| 349 | register Lisp_Object val; | ||
| 350 | int count = specpdl_ptr - specpdl; | ||
| 351 | |||
| 352 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | ||
| 353 | |||
| 339 | val = Fprogn (args); | 354 | val = Fprogn (args); |
| 340 | return unbind_to (count, val); | 355 | return unbind_to (count, val); |
| 341 | } | 356 | } |
| @@ -2515,6 +2530,7 @@ functions if all the text being accessed has this property."); | |||
| 2515 | /* defsubr (&Smark); */ | 2530 | /* defsubr (&Smark); */ |
| 2516 | /* defsubr (&Sset_mark); */ | 2531 | /* defsubr (&Sset_mark); */ |
| 2517 | defsubr (&Ssave_excursion); | 2532 | defsubr (&Ssave_excursion); |
| 2533 | defsubr (&Ssave_current_buffer); | ||
| 2518 | 2534 | ||
| 2519 | defsubr (&Sbufsize); | 2535 | defsubr (&Sbufsize); |
| 2520 | defsubr (&Spoint_max); | 2536 | defsubr (&Spoint_max); |