Mercurial > emacs
comparison src/process.c @ 17224:dd2545e79add
(wait_reading_process_input): If wait_for_cell,
ignore subprocess input and respond only to keyboard.
(non_process_wait_mask): New variable.
(add_keyboard_wait_descriptor): Update it.
(delete_keyboard_wait_descriptor): Update it.
(init_process): Initialize it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 22 Mar 1997 04:13:50 +0000 |
parents | 3a348cbb354f |
children | 351006378b51 |
comparison
equal
deleted
inserted
replaced
17223:ed068c0c1648 | 17224:dd2545e79add |
---|---|
222 | 222 |
223 /* Mask that excludes keyboard input descriptor (s). */ | 223 /* Mask that excludes keyboard input descriptor (s). */ |
224 | 224 |
225 static SELECT_TYPE non_keyboard_wait_mask; | 225 static SELECT_TYPE non_keyboard_wait_mask; |
226 | 226 |
227 /* Mask that excludes process input descriptor (s). */ | |
228 | |
229 static SELECT_TYPE non_process_wait_mask; | |
230 | |
227 /* The largest descriptor currently in use for a process object. */ | 231 /* The largest descriptor currently in use for a process object. */ |
228 static int max_process_desc; | 232 static int max_process_desc; |
229 | 233 |
230 /* The largest descriptor currently in use for keyboard input. */ | 234 /* The largest descriptor currently in use for keyboard input. */ |
231 static int max_keyboard_desc; | 235 static int max_keyboard_desc; |
2292 break; | 2296 break; |
2293 } | 2297 } |
2294 | 2298 |
2295 /* Wait till there is something to do */ | 2299 /* Wait till there is something to do */ |
2296 | 2300 |
2297 if (! XINT (read_kbd) && wait_for_cell == 0) | 2301 if (wait_for_cell) |
2302 Available = non_process_wait_mask; | |
2303 else if (! XINT (read_kbd)) | |
2298 Available = non_keyboard_wait_mask; | 2304 Available = non_keyboard_wait_mask; |
2299 else | 2305 else |
2300 Available = input_wait_mask; | 2306 Available = input_wait_mask; |
2301 | 2307 |
2302 /* If frame size has changed or the window is newly mapped, | 2308 /* If frame size has changed or the window is newly mapped, |
4039 { | 4045 { |
4040 if (! add_keyboard_wait_descriptor_called_flag) | 4046 if (! add_keyboard_wait_descriptor_called_flag) |
4041 FD_CLR (0, &input_wait_mask); | 4047 FD_CLR (0, &input_wait_mask); |
4042 add_keyboard_wait_descriptor_called_flag = 1; | 4048 add_keyboard_wait_descriptor_called_flag = 1; |
4043 FD_SET (desc, &input_wait_mask); | 4049 FD_SET (desc, &input_wait_mask); |
4050 FD_SET (desc, &non_process_wait_mask); | |
4044 if (desc > max_keyboard_desc) | 4051 if (desc > max_keyboard_desc) |
4045 max_keyboard_desc = desc; | 4052 max_keyboard_desc = desc; |
4046 } | 4053 } |
4047 | 4054 |
4048 /* From now on, do not expect DESC to give keyboard input. */ | 4055 /* From now on, do not expect DESC to give keyboard input. */ |
4053 { | 4060 { |
4054 int fd; | 4061 int fd; |
4055 int lim = max_keyboard_desc; | 4062 int lim = max_keyboard_desc; |
4056 | 4063 |
4057 FD_CLR (desc, &input_wait_mask); | 4064 FD_CLR (desc, &input_wait_mask); |
4065 FD_CLR (desc, &non_process_wait_mask); | |
4058 | 4066 |
4059 if (desc == max_keyboard_desc) | 4067 if (desc == max_keyboard_desc) |
4060 for (fd = 0; fd < lim; fd++) | 4068 for (fd = 0; fd < lim; fd++) |
4061 if (FD_ISSET (fd, &input_wait_mask) | 4069 if (FD_ISSET (fd, &input_wait_mask) |
4062 && !FD_ISSET (fd, &non_keyboard_wait_mask)) | 4070 && !FD_ISSET (fd, &non_keyboard_wait_mask)) |
4091 signal (SIGCHLD, sigchld_handler); | 4099 signal (SIGCHLD, sigchld_handler); |
4092 #endif | 4100 #endif |
4093 | 4101 |
4094 FD_ZERO (&input_wait_mask); | 4102 FD_ZERO (&input_wait_mask); |
4095 FD_ZERO (&non_keyboard_wait_mask); | 4103 FD_ZERO (&non_keyboard_wait_mask); |
4104 FD_ZERO (&non_process_wait_mask); | |
4096 max_process_desc = 0; | 4105 max_process_desc = 0; |
4097 | 4106 |
4098 FD_SET (0, &input_wait_mask); | 4107 FD_SET (0, &input_wait_mask); |
4099 | 4108 |
4100 Vprocess_alist = Qnil; | 4109 Vprocess_alist = Qnil; |