emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: new function process-file (call-process with file handlers)


From: Stefan Monnier
Subject: Re: Patch: new function process-file (call-process with file handlers)
Date: Sun, 17 Oct 2004 16:48:19 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> +(defun process-file (program &optional infile buffer display &rest args)
> +  "Process files synchronously in a separate process.
> +Similar to `call-process', but may invoke a file handler based on
> +`default-directory'.  The current working directory of the
> +subprocess is `default-directory'.
> +
> +File names in INFILE and BUFFER are handled normally, but file
> +names in ARGS should be relative to `default-directory', as they
> +are passed to the process verbatim.
> +
> +Some file handlers might not support all variants, for example
> +they might behave as if DISPLAY was nil, regardless of the actual
> +value passed."
> +  (let ((fh (find-file-name-handler default-directory 'process-file)))
> +    (if fh (apply fh 'process-file program infile buffer display args)
> +      (apply 'call-process program infile buffer display args))))

Looks good to me, except I'm not sure what INFILE should do.

I guess we could use the following convention: if it is a relative file
name, then it's a file on the remote host, otherwise, it's a file on the
local host that should be passed "manually" by reading the file in a buffer
and feeding it via the stdin pipe.

Same thing for STDERR-FILE.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]