From 66322887059e1f2711e07def5eff661281cee855 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 28 Aug 2012 10:20:08 +0400 Subject: Always use set_buffer_if_live to restore original buffer at unwind. * buffer.h (record_unwind_current_buffer): New function. * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c: * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c: * undo.c, window.c: Adjust users. * buffer.c (set_buffer_if_live): Fix comment. --- src/editfns.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/editfns.c') diff --git a/src/editfns.c b/src/editfns.c index 0bd632d14b7..7b451e4e443 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -946,13 +946,10 @@ BODY is executed just like `progn'. usage: (save-current-buffer &rest BODY) */) (Lisp_Object args) { - Lisp_Object val; ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); - - val = Fprogn (args); - return unbind_to (count, val); + record_unwind_current_buffer (); + return unbind_to (count, Fprogn (args)); } DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, -- cgit v1.2.3