From: Philipp Stephani <p.stephani2@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Philipp Stephani <phst@google.com>,
28691@debbugs.gnu.org, Emacs developers <emacs-devel@gnu.org>
Subject: bug#28691: [PATCH] Add file name handler support for 'make-process' (Bug#28691)
Date: Mon, 17 Dec 2018 20:07:49 +0100 [thread overview]
Message-ID: <CAArVCkSzt=pcVG9ZRpdT6oSi30ExcqBGAQ5J8b3x0+gkOo+d2w__39873.9697564908$1545074207$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <87zht45nw6.fsf@gmx.de>
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.)
next prev parent reply other threads:[~2018-12-17 19:07 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 17:13 bug#28691: 27.0.50; make-process has no file-name-handler Stefan Monnier
2017-10-03 17:50 ` Michael Albinus
2017-10-03 18:34 ` Eli Zaretskii
2018-12-16 23:39 ` [PATCH] Add file name handler support for 'make-process' (Bug#28691) Philipp Stephani
2018-12-17 17:34 ` bug#28691: " Eli Zaretskii
2018-12-17 17:54 ` Stefan Monnier
2018-12-17 19:49 ` Michael Albinus
2018-12-17 19:57 ` Stefan Monnier
2018-12-17 20:01 ` Eli Zaretskii
2018-12-17 17:34 ` Eli Zaretskii
2018-12-16 23:39 ` Philipp Stephani
2018-12-17 12:38 ` Michael Albinus
2018-12-17 17:35 ` Eli Zaretskii
2018-12-17 19:30 ` Michael Albinus
2018-12-17 19:30 ` Michael Albinus
2018-12-17 17:35 ` Eli Zaretskii
2018-12-17 19:07 ` Philipp Stephani
2018-12-17 19:20 ` Philipp Stephani
2018-12-17 19:58 ` Eli Zaretskii
2018-12-17 20:47 ` Philipp Stephani
2018-12-22 9:07 ` Eli Zaretskii
2018-12-22 9:31 ` Michael Albinus
2018-12-22 21:08 ` Philipp Stephani
2018-12-23 7:41 ` Michael Albinus
2018-12-23 10:08 ` Philipp Stephani
2018-12-23 10:26 ` Michael Albinus
2018-12-23 15:45 ` Eli Zaretskii
2018-12-23 16:36 ` Michael Albinus
2018-12-23 16:50 ` Eli Zaretskii
2018-12-22 22:26 ` Philipp Stephani
2018-12-17 19:33 ` Michael Albinus
2018-12-17 20:03 ` Drew Adams
2018-12-17 20:03 ` Drew Adams
2018-12-17 19:07 ` Philipp Stephani [this message]
[not found] ` <mailman.5866.1545079749.1284.bug-gnu-emacs@gnu.org>
2018-12-18 1:57 ` Alan Mackenzie
2018-12-18 7:56 ` Michael Albinus
2018-12-22 21:05 ` Philipp Stephani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAArVCkSzt=pcVG9ZRpdT6oSi30ExcqBGAQ5J8b3x0+gkOo+d2w__39873.9697564908$1545074207$gmane$org@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=28691@debbugs.gnu.org \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
--cc=phst@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.