[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#28691: [PATCH] Add file name handler support for 'make-process'
From: |
Michael Albinus |
Subject: |
Re: bug#28691: [PATCH] Add file name handler support for 'make-process' (Bug#28691) |
Date: |
Mon, 17 Dec 2018 20:30:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
Hi Eli,
>> What happens, if no file name handler is found? Should there be a local
>> process then, or should this be ignored (returning nil)?
>
> The proposed code runs the process locally, which I think is
> reasonable.
Yes, when default-directory is local.
If default-directory is remote, and :file-handler indicates that a
remote process shall run, the situation is different. If the
corresponding file name handler offers an own make-network-process
implementation, it returns that process. But if the file name handler
misses an implementation, no local process shall run.
This is the same situation as with start-file-process. The file name
handler for ssh returns a process object:
--8<---------------cut here---------------start------------->8---
(with-temp-buffer
(let ((default-directory "/ssh::"))
(start-file-process "foo" (current-buffer) "/bin/true")))
=> #<process foo>
--8<---------------cut here---------------end--------------->8---
But for Tramp methods which do not own a start-file-process
implementation, no process is created:
--8<---------------cut here---------------start------------->8---
(with-temp-buffer
(let ((default-directory "/sftp::"))
(start-file-process "foo" (current-buffer) "/bin/true")))
=> nil
--8<---------------cut here---------------end--------------->8---
This is documented in the Lisp Manual, see node "Asynchronous Processes":
--8<---------------cut here---------------start------------->8---
Some file handlers may not support ‘start-file-process’ (for
example the function ‘ange-ftp-hook-function’). In such cases,
this function does nothing and returns ‘nil’.
--8<---------------cut here---------------end--------------->8---
I believe make-network-process shall be have similar.
Best regards, Michael.