2010-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
+ * process.c (exec_sentinel): Preserve current-buffer.
+
* process.c (read_process_output): Move the save-current-buffer to
apply to both the filter and the non-filter branches.
XSETBUFFER (obuffer, current_buffer);
okeymap = current_buffer->keymap;
+ /* There's no good reason to let sentinels change the current
+ buffer, and many callers of accept-process-output, sit-for, and
+ friends don't expect current-buffer to be changed from under them. */
+ record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+
sentinel = p->sentinel;
if (NILP (sentinel))
return;