diff options
| author | Richard M. Stallman | 1993-10-22 01:16:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-10-22 01:16:04 +0000 |
| commit | 20ddfff7191bdbfbb419964a1ce129e050c4e382 (patch) | |
| tree | 0c42acd5f313278292c8864b919e46398d912fe7 /src/process.c | |
| parent | 4e24c6b147db4309dbf7134eb5a9c1cb279bc498 (diff) | |
| download | emacs-20ddfff7191bdbfbb419964a1ce129e050c4e382.tar.gz emacs-20ddfff7191bdbfbb419964a1ce129e050c4e382.zip | |
(status_notify): Don't read from process if filter is t.
(Fset_process_filter): Set or clear bit in input_wait_mask when nec.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index aa7ae12aff4..491baa6434c 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -678,6 +678,7 @@ DEFUN ("process-mark", Fprocess_mark, Sprocess_mark, | |||
| 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\ |
| @@ -686,6 +687,10 @@ If the process has a filter, its buffer is not used for output.") | |||
| 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 | } |
| @@ -2849,7 +2854,8 @@ status_notify () | |||
| 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 | ||