From: Stefan Monnier Date: Sun, 11 Apr 2010 16:15:09 +0000 (-0400) Subject: * process.c (exec_sentinel): Preserve current-buffer. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~543 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=97e53006f6c56bcbe190c56dadb350759644bfaa;p=emacs.git * process.c (exec_sentinel): Preserve current-buffer. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6f0e2a73ccf..92a05505d91 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2010-04-11 Stefan Monnier + * 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. diff --git a/src/process.c b/src/process.c index 69cd0d99c8a..4a1f31f66e7 100644 --- a/src/process.c +++ b/src/process.c @@ -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;