Mercurial > emacs
comparison src/process.c @ 4870:c53deda13fa9
(status_notify): Don't read from process if filter is t.
(Fset_process_filter): Set or clear bit in input_wait_mask when nec.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Fri, 22 Oct 1993 01:16:04 +0000 |
| parents | 1fc792473491 |
| children | a806d71f58f6 |
comparison
equal
deleted
inserted
replaced
| 4869:a3a72fce1143 | 4870:c53deda13fa9 |
|---|---|
| 676 } | 676 } |
| 677 | 677 |
| 678 DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, | 678 DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, |
| 679 2, 2, 0, | 679 2, 2, 0, |
| 680 "Give PROCESS the filter function FILTER; nil means no filter.\n\ | 680 "Give PROCESS the filter function FILTER; nil means no filter.\n\ |
| 681 t means stop accepting output from the process.\n\ | |
| 681 When a process has a filter, each time it does output\n\ | 682 When a process has a filter, each time it does output\n\ |
| 682 the entire string of output is passed to the filter.\n\ | 683 the entire string of output is passed to the filter.\n\ |
| 683 The filter gets two arguments: the process and the string of output.\n\ | 684 The filter gets two arguments: the process and the string of output.\n\ |
| 684 If the process has a filter, its buffer is not used for output.") | 685 If the process has a filter, its buffer is not used for output.") |
| 685 (proc, filter) | 686 (proc, filter) |
| 686 register Lisp_Object proc, filter; | 687 register Lisp_Object proc, filter; |
| 687 { | 688 { |
| 688 CHECK_PROCESS (proc, 0); | 689 CHECK_PROCESS (proc, 0); |
| 690 if (EQ (filter, Qt)) | |
| 691 FD_CLR (XPROCESS (proc)->infd, &input_wait_mask); | |
| 692 else if (EQ (XPROCESS (proc)->filter, Qt)) | |
| 693 FD_SET (XPROCESS (proc)->infd, &input_wait_mask); | |
| 689 XPROCESS (proc)->filter = filter; | 694 XPROCESS (proc)->filter = filter; |
| 690 return filter; | 695 return filter; |
| 691 } | 696 } |
| 692 | 697 |
| 693 DEFUN ("process-filter", Fprocess_filter, Sprocess_filter, | 698 DEFUN ("process-filter", Fprocess_filter, Sprocess_filter, |
| 2847 { | 2852 { |
| 2848 XSETINT (p->update_tick, XINT (p->tick)); | 2853 XSETINT (p->update_tick, XINT (p->tick)); |
| 2849 | 2854 |
| 2850 /* If process is still active, read any output that remains. */ | 2855 /* If process is still active, read any output that remains. */ |
| 2851 if (XFASTINT (p->infd)) | 2856 if (XFASTINT (p->infd)) |
| 2852 while (read_process_output (proc, XFASTINT (p->infd)) > 0); | 2857 while (! EQ (p->filter, Qt) |
| 2858 && read_process_output (proc, XFASTINT (p->infd)) > 0); | |
| 2853 | 2859 |
| 2854 buffer = p->buffer; | 2860 buffer = p->buffer; |
| 2855 | 2861 |
| 2856 /* Get the text to use for the message. */ | 2862 /* Get the text to use for the message. */ |
| 2857 if (!NILP (p->raw_status_low)) | 2863 if (!NILP (p->raw_status_low)) |
