From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: bug#28691: [PATCH] Add file name handler support for 'make-process' (Bug#28691) Date: Mon, 17 Dec 2018 19:34:23 +0200 Message-ID: <83a7l4dpls.fsf@gnu.org> References: <20181216233936.208568-1-phst@google.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1545067975 8641 195.159.176.226 (17 Dec 2018 17:32:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Dec 2018 17:32:55 +0000 (UTC) Cc: phst@google.com, 28691@debbugs.gnu.org, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 17 18:32:51 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 1gYwl8-000271-FT for ged-emacs-devel@m.gmane.org; Mon, 17 Dec 2018 18:32:50 +0100 Original-Received: from localhost ([::1]:48172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYwnF-00015m-6Y for ged-emacs-devel@m.gmane.org; Mon, 17 Dec 2018 12:35:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYwn5-00013B-I9 for emacs-devel@gnu.org; Mon, 17 Dec 2018 12:34:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYwn0-0007k9-KY for emacs-devel@gnu.org; Mon, 17 Dec 2018 12:34:51 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYwmZ-0007Ma-UF; Mon, 17 Dec 2018 12:34:21 -0500 Original-Received: from [176.228.60.248] (port=2175 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gYwmY-0006SP-7E; Mon, 17 Dec 2018 12:34:18 -0500 In-reply-to: <20181216233936.208568-1-phst@google.com> (message from Philipp Stephani on Mon, 17 Dec 2018 00:39:36 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:231883 Archived-At: > From: Philipp Stephani > Date: Mon, 17 Dec 2018 00:39:36 +0100 > Cc: Philipp Stephani > > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1407,6 +1407,10 @@ un-obsoleting it. > +++ > ** New function 'group-name' returns a group name corresponding to GID. > > +** 'make-process' now takes a keyword argument ':file-handler'; if > +that is non-nil, it will search for a file name handler for > +'default-directory'. I think the feature you introducing is not to "search for a file name handler for 'default-directory'", the feature is to (attempt to) make a remote process using that file handler. I think the documentation should make that more explicit, because I very much doubt it could be otherwise gleaned from this description. I'd also suggest to say "... the current buffer's 'default-directory'", just to make sure people don't miss that. > +:file-handler FILE-HANDLER -- If FILE-HANDLER is non-nil, then search > +for a file name handler for `default-directory'. Likewise here. Also, please describe what happens if the search for the handler fails. > +(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") /bin/true is not portable enough, I suggest to use Emacs itself instead. > + (let ((file-name-handler-alist > + (cons (cons (rx bos "test-handler:") #'file-handler) > + file-name-handler-alist)) I think it would be preferable to empty file-name-handler-alist of any other members -- that will make this test 100% deterministic. Thanks.