From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.devel
Subject: Re: bug#28691: [PATCH] Add file name handler support for
'make-process' (Bug#28691)
Date: Mon, 17 Dec 2018 20:07:49 +0100
Message-ID:
References:
<20181216233936.208568-1-phst__21526.1563113474$1545003551$gmane$org@google.com>
<87zht45nw6.fsf@gmx.de>
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1545073862 21062 195.159.176.226 (17 Dec 2018 19:11:02 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 17 Dec 2018 19:11:02 +0000 (UTC)
Cc: Philipp Stephani , 28691@debbugs.gnu.org,
Emacs developers
To: Michael Albinus
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 17 20:10:57 2018
Return-path:
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
by blaine.gmane.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1gYyI2-0005IE-1c
for ged-emacs-devel@m.gmane.org; Mon, 17 Dec 2018 20:10:54 +0100
Original-Received: from localhost ([::1]:48552 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1gYyK8-0001en-QJ
for ged-emacs-devel@m.gmane.org; Mon, 17 Dec 2018 14:13:04 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41228)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1gYyFH-0006N5-Il
for emacs-devel@gnu.org; Mon, 17 Dec 2018 14:08:06 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1gYyFG-0004bM-F1
for emacs-devel@gnu.org; Mon, 17 Dec 2018 14:08:03 -0500
Original-Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:34694)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1gYyFG-0004YE-88
for emacs-devel@gnu.org; Mon, 17 Dec 2018 14:08:02 -0500
Original-Received: by mail-ot1-x333.google.com with SMTP id t5so13275607otk.1
for ; Mon, 17 Dec 2018 11:08:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc:content-transfer-encoding;
bh=umgLWK6HE4q1LCBkvS7Q8Foll1pUPWTyZFpffXeXkx8=;
b=jl7ApkgQBkDlBu/sGm50gaUhCGWuj7QWONlkbyOAlMsiK6duF06wVOO+0+B39Qz8ff
3sciVXUMwsT43bayddVv035xETchBDa5AdbfSByCSedZXAa4td3Vu1RvYXau4v+jr92W
MQugBlO/4ARvzRdgV3QpnPPYLyVx959euhN+/vbMvHFUq4PFTIO+mAGXkQjU9z1LMTAB
wopZ+Wc6hQE3Jl7a+B9neEzlILPgRgIJM5ICxQF+xvZWEzpPuUZ2onIBA1H8g8xs8h+O
U6V0UCSvfCtgcllduQeGyw7uAbZkRC63lIWFfKbU8jOXzwWoIyGxQpbfysyPnzYOEdhi
AcUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc:content-transfer-encoding;
bh=umgLWK6HE4q1LCBkvS7Q8Foll1pUPWTyZFpffXeXkx8=;
b=RmAU58j5KrqS4LkQlW2pN0nS9KYZU3KbD8SWUJMwlkCYag2zQ4cVvUQzVE9r/Go7b5
P7ARjJqDiU0tgZnSI6ivlAoO4J7phWHaF5u1m+Id0LEqGPGw5qUEkLL7wB4NIC/jKw1O
ERXVj4v+Ac18okzSzGj9cXxA8wiaIbgnkqCgVeoIuMF2WZWK6K/AzHneecYT715lcCQm
crjHnCSgmPsOmN2KZ3a4wKuez6uAw7mJnoKL3unb+s2hj6tp2hKKw54pCpLREn52Vzpk
3rjDiP+ByomxSltQRm/MsnlK6nGJa5FBrt0iQwIQFqhiAUrR7oKz4BBVrFdVFVpEpJIP
lUBw==
X-Gm-Message-State: AA+aEWZ3rhrt5N7vD8GNxQifYUiUXC/PFgd6gMMRoiKr0FBgbHeadU67
ETvK0bsx+NaC6FjhWLdlzNZ/PoPaxNk1iYne0Qzr/Q==
X-Google-Smtp-Source: AFSGD/XdrcbtCHM4G1lIWhTZ4ZEqxXTs2v9u3t8kZaGvKBRmTf+zVllNAkYt5ejJ9WtID8cllxzxHLdEQTT0Ruotb0o=
X-Received: by 2002:a9d:2184:: with SMTP id s4mr322868otb.46.1545073680863;
Mon, 17 Dec 2018 11:08:00 -0800 (PST)
In-Reply-To: <87zht45nw6.fsf@gmx.de>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 2607:f8b0:4864:20::333
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Emacs development discussions."
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: "Emacs-devel"
Xref: news.gmane.org gmane.emacs.devel:231890
Archived-At:
Am Mo., 17. Dez. 2018 um 13:38 Uhr schrieb Michael Albinus
:
>
> Philipp Stephani 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 =E2=80=98:file-handler=E2=80=99 argument of =E2=80=
=98make-process=E2=80=99
> > +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 (=3D file-handler-calls 1))))))
>
> I would make a second test, that calling `make-process' w/o the
> `:file-handler' argument returns the plain process #.
>
> 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.)