bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#28691: [PATCH] Add file name handler support for 'make-process' (Bug


From: Michael Albinus
Subject: bug#28691: [PATCH] Add file name handler support for 'make-process' (Bug#28691)
Date: Sun, 23 Dec 2018 08:41:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Philipp Stephani <p.stephani2@gmail.com> writes:

Hi Philipp,

>> > this LGTM,
>>
>> Same here, but I still appreciate a clarification in the doc, that not
>> all file name handlers will support this function,
>
> That isn't the case:
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Magic-File-Names.html
> states clearly "The handler function must handle all of the above
> operations, and possibly others to be added in the future."

Tramp does *handle* all operations. But it does not *support* all of
them. In case it is not possible to offer an implementation for
`start-file-process' (as example), Tramp uses `ignore' as implementation.

>> and they will return
>> nil in that case.
>
> That is also not the case. If there's no handler, setting
> :file-handler to t has no effect. That's the same as for
> start-file-process, which calls start-process if no handler is found.

Of course. I do not speak about this case. Tramp offers a handler, which
will also supports `make-network-process'. This handler is called
`tramp-file-name-handler', and you see it in
`file-name-handler-alist'. But this handler could decide, that for a
given connection method there's nothing to do.

Remember the example I have shown already:

--8<---------------cut here---------------start------------->8---
(with-temp-buffer
  (let ((default-directory "/ssh::"))
    (start-file-process "foo" (current-buffer) "/bin/true")))
=> #<process foo>

(with-temp-buffer
  (let ((default-directory "/sftp::"))
    (start-file-process "foo" (current-buffer) "/bin/true")))
=> nil
--8<---------------cut here---------------end--------------->8---

"sftp" belongs to the connection methods implemented via GVFS, no
external processes are possible. See `tramp-gvfs-file-name-handler-alist',
many operations use `ignore' as their implementation. `make-network-process'
will get a similar entry.

Best regards, Michael.





reply via email to

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