or call strout to output a block of characters. */
#define PRINTPREPARE \
- struct buffer *old = current_buffer; \
ptrdiff_t old_point = -1, start_point = -1; \
ptrdiff_t old_point_byte = -1, start_point_byte = -1; \
specpdl_ref specpdl_count = SPECPDL_INDEX (); \
bool multibyte \
= !NILP (BVAR (current_buffer, enable_multibyte_characters)); \
Lisp_Object original = printcharfun; \
+ record_unwind_current_buffer (); \
if (NILP (printcharfun)) printcharfun = Qt; \
if (BUFFERP (printcharfun)) \
{ \
SET_PT_BOTH (old_point + (old_point >= start_point \
? PT - start_point : 0), \
old_point_byte + (old_point_byte >= start_point_byte \
- ? PT_BYTE - start_point_byte : 0)); \
- set_buffer_internal (old);
+ ? PT_BYTE - start_point_byte : 0));
/* This is used to restore the saved contents of print_buffer
when there is a recursive call to print. */