diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/process.c b/src/process.c index 275f3c15898..219098905cf 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -304,6 +304,10 @@ static int kbd_is_on_hold; | |||
| 304 | /* Nonzero means delete a process right away if it exits. */ | 304 | /* Nonzero means delete a process right away if it exits. */ |
| 305 | static int delete_exited_processes; | 305 | static int delete_exited_processes; |
| 306 | 306 | ||
| 307 | /* Nonzero means don't run process sentinels. This is used | ||
| 308 | when exiting. */ | ||
| 309 | int inhibit_sentinels; | ||
| 310 | |||
| 307 | #ifdef subprocesses | 311 | #ifdef subprocesses |
| 308 | 312 | ||
| 309 | /* Mask of bits indicating the descriptors that we wait for input on. */ | 313 | /* Mask of bits indicating the descriptors that we wait for input on. */ |
| @@ -381,10 +385,6 @@ struct sockaddr_and_len { | |||
| 381 | /* Maximum number of bytes to send to a pty without an eof. */ | 385 | /* Maximum number of bytes to send to a pty without an eof. */ |
| 382 | static int pty_max_bytes; | 386 | static int pty_max_bytes; |
| 383 | 387 | ||
| 384 | /* Nonzero means don't run process sentinels. This is used | ||
| 385 | when exiting. */ | ||
| 386 | int inhibit_sentinels; | ||
| 387 | |||
| 388 | #ifdef HAVE_PTYS | 388 | #ifdef HAVE_PTYS |
| 389 | #ifdef HAVE_PTY_H | 389 | #ifdef HAVE_PTY_H |
| 390 | #include <pty.h> | 390 | #include <pty.h> |
| @@ -5433,15 +5433,6 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5433 | unbind_to (count, Qnil); | 5433 | unbind_to (count, Qnil); |
| 5434 | return nbytes; | 5434 | return nbytes; |
| 5435 | } | 5435 | } |
| 5436 | |||
| 5437 | DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, | ||
| 5438 | 0, 0, 0, | ||
| 5439 | doc: /* Returns non-nil if Emacs is waiting for input from the user. | ||
| 5440 | This is intended for use by asynchronous process output filters and sentinels. */) | ||
| 5441 | (void) | ||
| 5442 | { | ||
| 5443 | return (waiting_for_user_input_p ? Qt : Qnil); | ||
| 5444 | } | ||
| 5445 | 5436 | ||
| 5446 | /* Sending data to subprocess */ | 5437 | /* Sending data to subprocess */ |
| 5447 | 5438 | ||
| @@ -7122,10 +7113,12 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 7122 | void | 7113 | void |
| 7123 | add_keyboard_wait_descriptor (int desc) | 7114 | add_keyboard_wait_descriptor (int desc) |
| 7124 | { | 7115 | { |
| 7116 | #ifdef subprocesses | ||
| 7125 | FD_SET (desc, &input_wait_mask); | 7117 | FD_SET (desc, &input_wait_mask); |
| 7126 | FD_SET (desc, &non_process_wait_mask); | 7118 | FD_SET (desc, &non_process_wait_mask); |
| 7127 | if (desc > max_keyboard_desc) | 7119 | if (desc > max_keyboard_desc) |
| 7128 | max_keyboard_desc = desc; | 7120 | max_keyboard_desc = desc; |
| 7121 | #endif | ||
| 7129 | } | 7122 | } |
| 7130 | 7123 | ||
| 7131 | /* From now on, do not expect DESC to give keyboard input. */ | 7124 | /* From now on, do not expect DESC to give keyboard input. */ |
| @@ -7277,6 +7270,19 @@ kill_buffer_processes (Lisp_Object buffer) | |||
| 7277 | #endif /* subprocesses */ | 7270 | #endif /* subprocesses */ |
| 7278 | } | 7271 | } |
| 7279 | 7272 | ||
| 7273 | DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, | ||
| 7274 | 0, 0, 0, | ||
| 7275 | doc: /* Returns non-nil if Emacs is waiting for input from the user. | ||
| 7276 | This is intended for use by asynchronous process output filters and sentinels. */) | ||
| 7277 | (void) | ||
| 7278 | { | ||
| 7279 | #ifdef subprocesses | ||
| 7280 | return (waiting_for_user_input_p ? Qt : Qnil); | ||
| 7281 | #else | ||
| 7282 | return Qnil; | ||
| 7283 | #endif | ||
| 7284 | } | ||
| 7285 | |||
| 7280 | /* Stop reading input from keyboard sources. */ | 7286 | /* Stop reading input from keyboard sources. */ |
| 7281 | 7287 | ||
| 7282 | void | 7288 | void |