diff src/process.c @ 10032:f689803caa92

Added code for automatically saving and restoring the match data when a filter or sentinel tries to modify it.
author Francesco Potortì <pot@gnu.org>
date Mon, 21 Nov 1994 12:50:27 +0000
parents 007d93b04e1f
children 68b8191091a7
line wrap: on
line diff
--- a/src/process.c	Sun Nov 20 21:55:55 1994 +0000
+++ b/src/process.c	Mon Nov 21 12:50:27 1994 +0000
@@ -2350,13 +2350,17 @@
       specbind (Qinhibit_quit, Qt);
       specbind (Qlast_nonmenu_event, Qt);
 
+      running_asynch_code = 1;
       internal_condition_case_1 (read_process_output_call,
 				 Fcons (outstream,
 					Fcons (proc,
-					       Fcons (make_string (chars, nchars),
+					       Fcons (make_string (chars,
+								   nchars),
 						      Qnil))),
 				 !NILP (Vdebug_on_error) ? Qnil : Qerror,
 				 read_process_output_error_handler);
+      running_asynch_code = 0;
+      restore_match_data ();
 
       /* Handling the process output should not deactivate the mark.  */
       Vdeactivate_mark = odeactivate;
@@ -3233,11 +3237,14 @@
   specbind (Qinhibit_quit, Qt);
   specbind (Qlast_nonmenu_event, Qt);
 
+  running_asynch_code = 1;
   internal_condition_case_1 (read_process_output_call,
 			     Fcons (sentinel,
 				    Fcons (proc, Fcons (reason, Qnil))),
 			     !NILP (Vdebug_on_error) ? Qnil : Qerror,
 			     exec_sentinel_error_handler);
+  running_asynch_code = 0;
+  restore_match_data ();
 
   Vdeactivate_mark = odeactivate;
   if (! EQ (Fcurrent_buffer (), obuffer))