aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/process.c b/src/process.c
index f3407838720..956f2b8fdb3 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2367,7 +2367,9 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2367 int wait_channel = -1; 2367 int wait_channel = -1;
2368 struct Lisp_Process *wait_proc = 0; 2368 struct Lisp_Process *wait_proc = 0;
2369 int got_some_input = 0; 2369 int got_some_input = 0;
2370 Lisp_Object *wait_for_cell = 0; 2370 /* Either nil or a cons cell, the car of which is of interest and
2371 may be changed outside of this routine. */
2372 Lisp_Object wait_for_cell = Qnil;
2371 2373
2372 FD_ZERO (&Available); 2374 FD_ZERO (&Available);
2373 2375
@@ -2383,7 +2385,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2383 /* If waiting for non-nil in a cell, record where. */ 2385 /* If waiting for non-nil in a cell, record where. */
2384 if (CONSP (read_kbd)) 2386 if (CONSP (read_kbd))
2385 { 2387 {
2386 wait_for_cell = &XCAR (read_kbd); 2388 wait_for_cell = read_kbd;
2387 XSETFASTINT (read_kbd, 0); 2389 XSETFASTINT (read_kbd, 0);
2388 } 2390 }
2389 2391
@@ -2417,7 +2419,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2417 QUIT; 2419 QUIT;
2418 2420
2419 /* Exit now if the cell we're waiting for became non-nil. */ 2421 /* Exit now if the cell we're waiting for became non-nil. */
2420 if (wait_for_cell && ! NILP (*wait_for_cell)) 2422 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
2421 break; 2423 break;
2422 2424
2423 /* Compute time from now till when time limit is up */ 2425 /* Compute time from now till when time limit is up */
@@ -2446,7 +2448,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2446 But not if wait_for_cell; in those cases, 2448 But not if wait_for_cell; in those cases,
2447 the wait is supposed to be short, 2449 the wait is supposed to be short,
2448 and those callers cannot handle running arbitrary Lisp code here. */ 2450 and those callers cannot handle running arbitrary Lisp code here. */
2449 if (! wait_for_cell) 2451 if (NILP (wait_for_cell))
2450 { 2452 {
2451 EMACS_TIME timer_delay; 2453 EMACS_TIME timer_delay;
2452 2454
@@ -2567,7 +2569,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2567 2569
2568 /* Wait till there is something to do */ 2570 /* Wait till there is something to do */
2569 2571
2570 if (wait_for_cell) 2572 if (!NILP (wait_for_cell))
2571 Available = non_process_wait_mask; 2573 Available = non_process_wait_mask;
2572 else if (! XINT (read_kbd)) 2574 else if (! XINT (read_kbd))
2573 Available = non_keyboard_wait_mask; 2575 Available = non_keyboard_wait_mask;
@@ -2723,7 +2725,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2723 } 2725 }
2724 2726
2725 /* Exit now if the cell we're waiting for became non-nil. */ 2727 /* Exit now if the cell we're waiting for became non-nil. */
2726 if (wait_for_cell && ! NILP (*wait_for_cell)) 2728 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
2727 break; 2729 break;
2728 2730
2729#ifdef SIGIO 2731#ifdef SIGIO
@@ -2742,7 +2744,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2742 2744
2743 /* If checking input just got us a size-change event from X, 2745 /* If checking input just got us a size-change event from X,
2744 obey it now if we should. */ 2746 obey it now if we should. */
2745 if (XINT (read_kbd) || wait_for_cell) 2747 if (XINT (read_kbd) || ! NILP (wait_for_cell))
2746 do_pending_window_change (0); 2748 do_pending_window_change (0);
2747 2749
2748 /* Check for data from a process. */ 2750 /* Check for data from a process. */
@@ -4768,12 +4770,14 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4768 EMACS_TIME end_time, timeout; 4770 EMACS_TIME end_time, timeout;
4769 SELECT_TYPE waitchannels; 4771 SELECT_TYPE waitchannels;
4770 int xerrno; 4772 int xerrno;
4771 Lisp_Object *wait_for_cell = 0; 4773 /* Either nil or a cons cell, the car of which is of interest and
4774 may be changed outside of this routine. */
4775 Lisp_Object wait_for_cell = Qnil;
4772 4776
4773 /* If waiting for non-nil in a cell, record where. */ 4777 /* If waiting for non-nil in a cell, record where. */
4774 if (CONSP (read_kbd)) 4778 if (CONSP (read_kbd))
4775 { 4779 {
4776 wait_for_cell = &XCAR (read_kbd); 4780 wait_for_cell = read_kbd;
4777 XSETFASTINT (read_kbd, 0); 4781 XSETFASTINT (read_kbd, 0);
4778 } 4782 }
4779 4783
@@ -4800,7 +4804,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4800 QUIT; 4804 QUIT;
4801 4805
4802 /* Exit now if the cell we're waiting for became non-nil. */ 4806 /* Exit now if the cell we're waiting for became non-nil. */
4803 if (wait_for_cell && ! NILP (*wait_for_cell)) 4807 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
4804 break; 4808 break;
4805 4809
4806 /* Compute time from now till when time limit is up */ 4810 /* Compute time from now till when time limit is up */
@@ -4829,7 +4833,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4829 run timer events directly. 4833 run timer events directly.
4830 (Callers that will immediately read keyboard events 4834 (Callers that will immediately read keyboard events
4831 call timer_delay on their own.) */ 4835 call timer_delay on their own.) */
4832 if (! wait_for_cell) 4836 if (NILP (wait_for_cell))
4833 { 4837 {
4834 EMACS_TIME timer_delay; 4838 EMACS_TIME timer_delay;
4835 4839
@@ -4870,7 +4874,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4870 4874
4871 /* Wait till there is something to do. */ 4875 /* Wait till there is something to do. */
4872 4876
4873 if (! XINT (read_kbd) && wait_for_cell == 0) 4877 if (! XINT (read_kbd) && NILP (wait_for_cell))
4874 FD_ZERO (&waitchannels); 4878 FD_ZERO (&waitchannels);
4875 else 4879 else
4876 FD_SET (0, &waitchannels); 4880 FD_SET (0, &waitchannels);
@@ -4946,7 +4950,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4946 input at all when wait_for_cell, but the code 4950 input at all when wait_for_cell, but the code
4947 has been this way since July 1994. 4951 has been this way since July 1994.
4948 Try changing this after version 19.31.) */ 4952 Try changing this after version 19.31.) */
4949 if (wait_for_cell 4953 if (! NILP (wait_for_cell)
4950 && detect_input_pending ()) 4954 && detect_input_pending ())
4951 { 4955 {
4952 swallow_events (do_display); 4956 swallow_events (do_display);
@@ -4955,7 +4959,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4955 } 4959 }
4956 4960
4957 /* Exit now if the cell we're waiting for became non-nil. */ 4961 /* Exit now if the cell we're waiting for became non-nil. */
4958 if (wait_for_cell && ! NILP (*wait_for_cell)) 4962 if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
4959 break; 4963 break;
4960 } 4964 }
4961 4965