* process.c (exec_sentinel): Preserve current-buffer.

This commit is contained in:
Stefan Monnier 2010-04-11 12:15:09 -04:00
parent 3a4fa2f208
commit 97e53006f6
2 changed files with 7 additions and 0 deletions

View file

@ -1,5 +1,7 @@
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.

View file

@ -6840,6 +6840,11 @@ exec_sentinel (proc, reason)
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;