unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Make call-process (and start-process?) filename handlers?
@ 2002-12-28 22:31 Kai Großjohann
  2002-12-31  5:47 ` Richard Stallman
  0 siblings, 1 reply; 14+ messages in thread
From: Kai Großjohann @ 2002-12-28 22:31 UTC (permalink / raw)


I think it would be good to change call-process to check for a
filename handler, based on the value of default-directory.

VC uses call-process (or start-process) for the external programs;
with this change it would automagically work for remote files.  (If
the corresponding filename handler implements call-process, of
course.)

Currently, shell-command chooses a filename handler based on
default-directory.  call-process is not currently a file operation.

Previously, Richard suggested to implement an operation
process-file.  One of the arguments would be the filename to use for
finding the right filename handler.

I think that process-file leads to unnecessary complications.  For
example, what happens if the file to process is /user@host:/file1 and
one of the other args is /user@host:/file2?  Should that be
interpreted as a filename and passed to the remote program as "/file2"
or "file2"?  Or should it be interpreted as a string and passed as
"/user@host:/file2"?  Clearly, it can be both, so the interface for
process-file needs to provide a way to specify which interpretation
to use.  Another complication is that the filename that determines
the handler can be at various positions in the arg list, which makes
the interface to process-file complicated.

With call-process, one can just make all filenames relative to
default-directory before invoking call-process.  Then it will just
work.

In the unlikely event that somebody successfully invoked call-process
where default-directory was pointing to a remote directory, this
invocation can easily be rectified by let-binding default-directory
to "/" (on Windows, maybe "c:/"?) arount that problematic
invocation.  I have not done investigations on how unlikely that
event is, though.

What do people think?
-- 
Ambibibentists unite!

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

end of thread, other threads:[~2003-01-15 23:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-28 22:31 Make call-process (and start-process?) filename handlers? Kai Großjohann
2002-12-31  5:47 ` Richard Stallman
2002-12-31 18:54   ` Kevin Rodgers
2003-01-02 18:38     ` Richard Stallman
2003-01-10 23:52   ` Stefan Monnier
2003-01-11 21:33     ` Kai Großjohann
2003-01-13 10:42       ` Richard Stallman
2003-01-12 11:55     ` Richard Stallman
2003-01-12 14:54       ` Kai Großjohann
2003-01-13 10:21         ` Andreas Schwab
2003-01-13 11:41           ` Ehud Karni
2003-01-14 18:54             ` Richard Stallman
2003-01-14 22:42               ` Luc Teirlinck
2003-01-15 23:28                 ` Richard Stallman

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).