changeset 107826:6438b98db9dd

* process.c (exec_sentinel): Preserve current-buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 11 Apr 2010 12:15:09 -0400
parents 57e2e94dbe55
children aa85632b7860 6d3accd249f7
files src/ChangeLog src/process.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Apr 11 11:53:13 2010 -0400
+++ b/src/ChangeLog	Sun Apr 11 12:15:09 2010 -0400
@@ -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.
 
--- a/src/process.c	Sun Apr 11 11:53:13 2010 -0400
+++ b/src/process.c	Sun Apr 11 12:15:09 2010 -0400
@@ -6840,6 +6840,11 @@
   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;