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: Philipp Stephani
Subject: bug#28691: [PATCH] Add file name handler support for 'make-process' (Bug#28691)
Date: Sun, 23 Dec 2018 11:08:30 +0100

Am So., 23. Dez. 2018 um 08:41 Uhr schrieb Michael Albinus
<michael.albinus@gmx.de>:
>
> 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.

Yes, I've seen this, but it's a characteristic of Tramp, not of Emacs
itself, so I don't think it should be documented in the Elisp manual
itself.
I also think that Tramp should actually not return nil, but signal an
error instead. make-process either returns a process object or signals
an error (except for a weird corner case with zero arguments), and I
think file name handlers handling make-process should behave the same.

>
> >> 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]