changeset 5881:31dd275fa683

Preserv the current buffer on non-local exit, #'accept-process-output. 2015-03-31 Aidan Kehoe <kehoea@parhasard.net> * event-stream.c (Faccept_process_output): Restore the current buffer even on non-local exit in this function, none of the code that uses #'accept-process-output is actually prepared to handle the current buffer changing.
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 31 Mar 2015 18:42:21 +0100
parents 44ba043ceada
children bbe4146603db
files src/ChangeLog src/event-stream.c
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Mar 28 16:03:33 2015 -0400
+++ b/src/ChangeLog	Tue Mar 31 18:42:21 2015 +0100
@@ -1,3 +1,10 @@
+2015-03-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* event-stream.c (Faccept_process_output):
+	Restore the current buffer even on non-local exit in this
+	function, none of the code that uses #'accept-process-output is
+	actually prepared to handle the current buffer changing.
+
 2015-03-27  Vin Shelton  <acs@xemacs.org>
 
 	* s/cygwin64.h: Fixed another stupid typo.
--- a/src/event-stream.c	Sat Mar 28 16:03:33 2015 -0400
+++ b/src/event-stream.c	Tue Mar 31 18:42:21 2015 +0100
@@ -2617,7 +2617,6 @@
   int timeout_id = -1;
   int timeout_enabled = 0;
   int done = 0;
-  struct buffer *old_buffer = current_buffer;
   int count;
 
   /* We preserve the current buffer but nothing else.  If a focus
@@ -2654,6 +2653,7 @@
   record_unwind_protect (sit_for_unwind,
 			 timeout_enabled ? make_fixnum (timeout_id) : Qnil);
   recursive_sit_for = 1;
+  record_unwind_protect (Fset_buffer, wrap_buffer (current_buffer));
 
   while (!done &&
          ((NILP (process) && timeout_enabled) ||
@@ -2723,7 +2723,7 @@
   status_notify ();
 
   UNGCPRO;
-  current_buffer = old_buffer;
+
   return result;
 }