unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Proposal for extending set-process-filter
@ 2004-04-26 23:55 David Kastrup
  2004-04-27 15:01 ` Stefan Monnier
  2004-04-27 16:30 ` Richard Stallman
  0 siblings, 2 replies; 11+ messages in thread
From: David Kastrup @ 2004-04-26 23:55 UTC (permalink / raw)



Currently, processes called with call-process can't have their stdout
and stderr directed to different buffers/filter functions/whatever.
This is painfully obvious when using pipes and redirections in eshell.

I'd propose that set-process-filter gets extended in the following
way:

set-process-filter is a built-in function in `src/process.c'.
(set-process-filter PROCESS FILTER)

Give PROCESS the filter function FILTER; nil means no filter.
t means stop accepting output from the process.

A filter can be 

1) a function which gets two arguments. [insert old description]
2) a buffer into which output gets inserted.
3) a file name for output.
4) t to stop accepting output.
5) a list of filter/file descriptor associations.
The car's of the elements of this list are an item from 1)-4) as
above, while the cdr is a list of file ids for which this item is
supposed to apply.

So to redirect output of stdout and stderr to /dev/null, you'd specify
(set-process-filter my-process '(("/dev/null" 1 2)))

If a list is specified in this manner, the operation of unspecified
file descriptors is not affected.

This does not yet do everything needed for a full-bodied eshell: input
redirections (including procedural input, equivalents to filter
functions) and output appending redirection (>>) are not covered
yet.  But it would be a first step.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-04-29 10:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-26 23:55 Proposal for extending set-process-filter David Kastrup
2004-04-27 15:01 ` Stefan Monnier
2004-04-27 15:33   ` David Kastrup
2004-04-27 18:51     ` Stefan Monnier
2004-04-27 20:46       ` David Kastrup
2004-04-27 16:30 ` Richard Stallman
2004-04-27 18:53   ` Stefan Monnier
2004-04-27 20:59     ` David Kastrup
2004-04-29 10:44       ` Richard Stallman
2004-04-27 21:10   ` David Kastrup
2004-04-27 21:25     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).