From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Patch: new function process-file (call-process with file handlers)
Date: Sun, 17 Oct 2004 16:48:19 -0400 [thread overview]
Message-ID: <877jppm5x6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86y8i5m9tf.fsf@ketchup.de.uu.net> (Kai Grossjohann's message of "Sun, 17 Oct 2004 21:19:40 +0200")
> +(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
next prev parent reply other threads:[~2004-10-17 20:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-17 15:53 Patch: new function process-file (call-process with file handlers) Kai Grossjohann
2004-10-17 16:57 ` David Kastrup
2004-10-17 16:58 ` Stefan Monnier
2004-10-18 8:28 ` Kim F. Storm
2004-10-18 10:24 ` David Kastrup
2004-10-24 13:27 ` Kai Grossjohann
2004-10-17 19:19 ` Kai Grossjohann
2004-10-17 20:48 ` Stefan Monnier [this message]
2004-10-18 6:44 ` Kai Grossjohann
2004-10-18 13:59 ` Richard Stallman
2004-10-19 6:37 ` Michael Albinus
2004-10-23 20:03 ` Kai Grossjohann
2004-10-24 1:17 ` Luc Teirlinck
2004-10-24 9:10 ` Kai Grossjohann
2004-10-24 15:09 ` Luc Teirlinck
2004-10-24 18:29 ` Luc Teirlinck
2004-10-24 20:06 ` Kai Grossjohann
2004-10-24 18:46 ` Luc Teirlinck
2004-10-24 19:30 ` Luc Teirlinck
2004-10-24 19:37 ` Luc Teirlinck
2004-10-24 20:08 ` Kai Grossjohann
2004-10-24 20:22 ` Luc Teirlinck
2004-10-24 20:59 ` Luc Teirlinck
2004-10-18 19:52 ` Michael Albinus
2004-10-23 20:00 ` Kai Grossjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877jppm5x6.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).