summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-06-07 18:53:27 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-06-07 19:11:49 -0700
commita0aa1d4ecc123d652285ef10ea62ed55c6c118d6 (patch)
treec56177683a5a552e17eb8ce7ed27256507361b60 /src/eval.c
parenta0641286f6e58f4dca4221caa6dd559bfacea699 (diff)
downloademacs-a0aa1d4ecc123d652285ef10ea62ed55c6c118d6.tar.gz
emacs-a0aa1d4ecc123d652285ef10ea62ed55c6c118d6.tar.bz2
emacs-a0aa1d4ecc123d652285ef10ea62ed55c6c118d6.zip
New function record_unwind_protect_excursion
This simplifies callers a bit, and will simplify future changes. * src/eval.c (record_unwind_protect_excursion): New function. * src/buffer.c (Fkill_buffer): * src/bytecode.c (exec_byte_code): * src/editfns.c (Fsave_excursion, Freplace_buffer_contents): * src/lread.c (readevalloop, Feval_buffer): * src/window.c (scroll_command): Use it.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 90d8c335185..86011a234c0 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3415,6 +3415,12 @@ record_unwind_protect_int (void (*function) (int), int arg)
}
void
+record_unwind_protect_excursion (void)
+{
+ record_unwind_protect (save_excursion_restore, save_excursion_save ());
+}
+
+void
record_unwind_protect_void (void (*function) (void))
{
specpdl_ptr->unwind_void.kind = SPECPDL_UNWIND_VOID;