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: Mon, 17 Dec 2018 20:07:49 +0100

Am Mo., 17. Dez. 2018 um 13:38 Uhr schrieb Michael Albinus
<michael.albinus@gmx.de>:
>
> Philipp Stephani <p.stephani2@gmail.com> writes:
>
> Hi Philipp,
>
> > +:file-handler FILE-HANDLER -- If FILE-HANDLER is non-nil, then search
> > +for a file name handler for `default-directory'.
>
> What happens, if no file name handler is found? Should there be a local
> process then, or should this be ignored (returning nil)?

I think it should be a new process, like start-file-process does.
(make-process should always either return a process object or fail.)

>
> > +(ert-deftest make-process/file-handler ()
> > +  "Check that the ‘:file-handler’ argument of ‘make-process’
> > +works as expected."
> > +  (let ((file-handler-calls 0))
> > +    (cl-flet ((file-handler
> > +               (&rest args)
> > +               (should (equal default-directory "test-handler:/dir/"))
> > +               (should (equal args '(make-process :name "name"
> > +                                                  :command ("/bin/true")
> > +                                                  :file-handler t)))
> > +               (cl-incf file-handler-calls)
> > +               'fake-process))
> > +      (let ((file-name-handler-alist
> > +             (cons (cons (rx bos "test-handler:") #'file-handler)
> > +                   file-name-handler-alist))
> > +            (default-directory "test-handler:/dir/"))
> > +        (should (eq (make-process :name "name"
> > +                                  :command '("/bin/true")
> > +                                  :file-handler t)
> > +                    'fake-process))
> > +        (should (= file-handler-calls 1))))))
>
> I would make a second test, that calling `make-process' w/o the
> `:file-handler' argument returns the plain process #<process name>.
>
> The third test is for using non-nil `:file-handler', w/o finding one.
> This returns either a local process, or nil (see remark above).
>
> I also miss documentation in the Elisp manual, nodes "Magic File Names"
> and "Asynchronous Processes".

Good points, I'll incorporate them in a follow-up patch.

>
> And of course, the implementation of a file name handler is missing in
> tramp-adb.el, tramp-sh.el and tramp-smb.el.

That should be part of a different bug. (Since make-process is more
capable than start-file-process, implementing Tramp support will be a
bit more difficult.)





reply via email to

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