From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: 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 1545074207 15753 195.159.176.226 (17 Dec 2018 19:16:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 17 Dec 2018 19:16:47 +0000 (UTC)
Cc: Philipp Stephani , 28691@debbugs.gnu.org,
Emacs developers
To: Michael Albinus
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 17 20:16:42 2018
Return-path:
Envelope-to: geb-bug-gnu-emacs@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 1gYyNc-0003z6-FY
for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Dec 2018 20:16:40 +0100
Original-Received: from localhost ([::1]:48603 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1gYyPj-0005VD-1n
for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Dec 2018 14:18:51 -0500
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41720)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1gYyGH-0007JL-Bv
for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 14:09:06 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1gYyGE-0005ap-On
for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 14:09:05 -0500
Original-Received: from debbugs.gnu.org ([208.118.235.43]:47873)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1gYyGE-0005aU-KH
for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 14:09:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1gYyGE-0007p4-72
for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2018 14:09:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 17 Dec 2018 19:09:02 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 28691
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 28691-submit@debbugs.gnu.org id=B28691.154507368830004
(code B ref 28691); Mon, 17 Dec 2018 19:09:02 +0000
Original-Received: (at 28691) by debbugs.gnu.org; 17 Dec 2018 19:08:08 +0000
Original-Received: from localhost ([127.0.0.1]:52131 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1gYyFM-0007ns-IA
for submit@debbugs.gnu.org; Mon, 17 Dec 2018 14:08:08 -0500
Original-Received: from mail-ot1-f45.google.com ([209.85.210.45]:37543)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1gYyFK-0007nQ-QA
for 28691@debbugs.gnu.org; Mon, 17 Dec 2018 14:08:07 -0500
Original-Received: by mail-ot1-f45.google.com with SMTP id 40so13240794oth.4
for <28691@debbugs.gnu.org>; Mon, 17 Dec 2018 11:08:06 -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=LuBJRi1K9KKXPC5/BTXNsRA5oCfC0xNLp2/2BsNJGElrjVAJ+N0zMbFQQ3EL07uwnq
pOrkuh1M3k1N5uWI3l+OmtxAy7VSg5kjWqwepi68j49G+DMVUuhO3siscN7Xx7occZqm
OSybPI6hmexGxWVNg+NnHT66dfpcUqJPAGMVTwH4oy+W232aSWlqIbPz0jhJwYWEjTbb
zm7LNoR6jNju/RFyd8oxvRIc/J1iUOqtHHt23Ry0XMxFtA3mp+hH8OSm73JiX9fZlW+m
BKKxFFydVNoNM+OPmwyuvVr/uVIhPdr83MOObWS3RS5wVF7H1l85cJw+YSuLqvdt2z+W
yFUQ==
X-Gm-Message-State: AA+aEWYMVFqNA/wARgr5t20p7Fmxaq94sk2OxbYYTWzZg4JhbFX6kszS
OKvhU50nkp6q4CUz/kPT+HDK8ul+4gOvPvjvB2c=
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-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.org gmane.emacs.bugs:153526
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.)