X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5886acf9ae69668883973a39db9176fa99c1d1c0..c7dd82a34d3b058a81d11823a7f730f6607bd43d:/src/process.c diff --git a/src/process.c b/src/process.c index acd2d0b08f..1230887888 100644 --- a/src/process.c +++ b/src/process.c @@ -196,11 +196,12 @@ static Lisp_Object Vprocess_connection_type; #endif #endif /* SKTPAIR */ +/* These next two vars are non-static since sysdep.c uses them in the + emulation of `select'. */ /* Number of events of change of status of a process. */ -static int process_tick; - +int process_tick; /* Number of events for which the user or sentinel has been notified. */ -static int update_tick; +int update_tick; #include "sysselect.h" @@ -1034,9 +1035,9 @@ Remaining arguments are strings to give program as arguments.") GCPRO2 (buffer, current_dir); - current_dir = - expand_and_dir_to_file - (Funhandled_file_name_directory (current_dir), Qnil); + current_dir + = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir), + Qnil); if (NILP (Ffile_accessible_directory_p (current_dir))) report_file_error ("Setting current directory", Fcons (current_buffer->directory, Qnil)); @@ -1116,6 +1117,11 @@ Remaining arguments are strings to give program as arguments.") XPROCESS (proc)->filter = Qnil; XPROCESS (proc)->command = Flist (nargs - 2, args + 2); + /* Make the process marker point into the process buffer (if any). */ + if (!NILP (buffer)) + Fset_marker (XPROCESS (proc)->mark, + make_number (BUF_ZV (XBUFFER (buffer))), buffer); + create_process (proc, new_argv, current_dir); return unbind_to (count, proc); @@ -2323,10 +2329,13 @@ read_process_output (proc, channel) it up. */ int count = specpdl_ptr - specpdl; Lisp_Object odeactivate; - Lisp_Object obuffer; + Lisp_Object obuffer, okeymap; + /* No need to gcpro these, because all we do with them later + is test them for EQness, and none of them should be a string. */ odeactivate = Vdeactivate_mark; - obuffer = Fcurrent_buffer (); + XSETBUFFER (obuffer, current_buffer); + okeymap = current_buffer->keymap; specbind (Qinhibit_quit, Qt); specbind (Qlast_nonmenu_event, Qt); @@ -2346,7 +2355,8 @@ read_process_output (proc, channel) /* Handling the process output should not deactivate the mark. */ Vdeactivate_mark = odeactivate; - if (! EQ (Fcurrent_buffer (), obuffer)) + if (! EQ (Fcurrent_buffer (), obuffer) + || ! EQ (current_buffer->keymap, okeymap)) record_asynch_buffer_change (); if (waiting_for_user_input_p) @@ -3200,12 +3210,16 @@ static void exec_sentinel (proc, reason) Lisp_Object proc, reason; { - Lisp_Object sentinel, obuffer, odeactivate; + Lisp_Object sentinel, obuffer, odeactivate, okeymap; register struct Lisp_Process *p = XPROCESS (proc); int count = specpdl_ptr - specpdl; + /* No need to gcpro these, because all we do with them later + is test them for EQness, and none of them should be a string. */ odeactivate = Vdeactivate_mark; - obuffer = Fcurrent_buffer (); + XSETBUFFER (obuffer, current_buffer); + okeymap = current_buffer->keymap; + sentinel = p->sentinel; if (NILP (sentinel)) return; @@ -3228,7 +3242,8 @@ exec_sentinel (proc, reason) restore_match_data (); Vdeactivate_mark = odeactivate; - if (! EQ (Fcurrent_buffer (), obuffer)) + if (! EQ (Fcurrent_buffer (), obuffer) + || ! EQ (current_buffer->keymap, okeymap)) record_asynch_buffer_change (); if (waiting_for_user_input_p)