From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#19394: 25.0.50; mpc does not handle MPD_HOST=socket Date: Wed, 2 Sep 2015 13:29:24 -0400 Message-ID: <20150902172924.GA31556@holos> References: <87y4q7wkdc.fsf@udel.edu> <874mkhr0zu.fsf@udel.edu> <83h9ohv75m.fsf@gnu.org> <87a8u9mkg8.fsf@udel.edu> <8737z4hcmi.fsf@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1441215029 11735 80.91.229.3 (2 Sep 2015 17:30:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2015 17:30:29 +0000 (UTC) To: 19394@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 02 19:30:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZXBrS-0004xQ-Ux for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 19:30:15 +0200 Original-Received: from localhost ([::1]:39877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBrS-0002bP-7G for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Sep 2015 13:30:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBrO-0002bA-76 for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:30:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXBrK-0000uN-1d for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:30:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBrJ-0000tr-Tu for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZXBrI-0000U1-Rr for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:30:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Sep 2015 17:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19394 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14412149771761 (code B ref -1); Wed, 02 Sep 2015 17:30:04 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Sep 2015 17:29:37 +0000 Original-Received: from localhost ([127.0.0.1]:46676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXBqq-0000SJ-Uj for submit@debbugs.gnu.org; Wed, 02 Sep 2015 13:29:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40998) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXBqo-0000S5-MO for submit@debbugs.gnu.org; Wed, 02 Sep 2015 13:29:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXBqn-0000Z6-8Z for submit@debbugs.gnu.org; Wed, 02 Sep 2015 13:29:34 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBqn-0000Z2-52 for submit@debbugs.gnu.org; Wed, 02 Sep 2015 13:29:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBql-0002QP-UB for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:29:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXBqh-0000Tk-PP for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:29:31 -0400 Original-Received: from mail-qg0-f51.google.com ([209.85.192.51]:34617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXBqh-0000TY-Lo for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2015 13:29:27 -0400 Original-Received: by qgez77 with SMTP id z77so10051303qge.1 for ; Wed, 02 Sep 2015 10:29:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=E6WWr2gjaTm32dJawI6Be/2ZP+9bqUDvbm5zbAoAzc4=; b=OWZ++Xn0MR576ZnpJclfTkKeUI12npyDndkl+XbhkDfbSQfbDbUR0cWD8gAW5/uQOa ms9IdywddAlOY019FU6Lr55RrUCpdqSpt95yEfWYgkq4YRzokk3s/Ggthxv/DcV97+XI VvwukzQkBWJqsUXJXeXhg0AIbqFjRuobz6enXu3v6UqANSJfNZHJmG/Ys2wyZBp3EUcW sY2GYj2dkJIFBP26Tbqwr/q9Lq2rSmDIv8FAgKSmatE3gxvT+Uc81hVsP25FG7hNAzG8 ThLl6Povtv4fA39TjEYwkRhz3sCxvyj1PsT3BoBWbccaEiaj2iKPwmQTAEqLeOMnLPOs CH2A== X-Gm-Message-State: ALoCoQlOkxMTrIPeNVTrfpyg7NshL8Upp7JNhGIGQ8133hIgD3zDrxqj4rKCgubd4U0ltioQsDET X-Received: by 10.140.134.21 with SMTP id 21mr63675228qhg.51.1441214966874; Wed, 02 Sep 2015 10:29:26 -0700 (PDT) Original-Received: from holos.localdomain (c-73-172-248-173.hsd1.md.comcast.net. [73.172.248.173]) by smtp.gmail.com with ESMTPSA id m82sm13125444qhb.19.2015.09.02.10.29.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 10:29:26 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 46F5368971; Wed, 2 Sep 2015 13:29:24 -0400 (EDT) Content-Disposition: inline In-Reply-To: <8737z4hcmi.fsf@udel.edu> User-Agent: Mutt/1.5.24+3 (62730ecbc17d) (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106093 Archived-At: Mark Oteiza writes: > Eli Zaretskii writes: > >>> From: Mark Oteiza >>> Date: Sun, 02 Aug 2015 14:36:37 -0400 >>> >>> Here's a patch for handling the MPD_HOST being a socket. >> >> Thanks. >> >>> + :remote (if (string-prefix-p "/" host) >>> + host)) >> >> This looks wrong to me, the proper test for a remote file name is >> file-remote-p (if this is what you want to test here). > > Yeah you're right, I was abusing this wording for :remote > > When specified for a client process, the FAMILY, HOST, and SERVICE > args are ignored. > > when I should have been using :family and :service together. This should > be better: > >>>From 83d7ef4cc27580248c6584d2f141afa50624c951 Mon Sep 17 00:00:00 2001 > From: Mark Oteiza > Date: Sun, 2 Aug 2015 17:44:27 -0400 > Subject: [PATCH] mpc.el (mpc--proc-connect): support UNIX addresses > (Bug#19394) > > --- > lisp/mpc.el | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/lisp/mpc.el b/lisp/mpc.el > index 76c08db..396e067 100644 > --- a/lisp/mpc.el > +++ b/lisp/mpc.el > @@ -253,6 +253,7 @@ defaults to 6600 and HOST defaults to localhost." > > (defun mpc--proc-connect (host) > (let ((port 6600) > + local > pass) > > (when (string-match "\\`\\(?:\\(.*\\)@\\)?\\(.*?\\)\\(?::\\(.*\\)\\)?\\'" > @@ -267,6 +268,8 @@ defaults to 6600 and HOST defaults to localhost." > (if (string-match "[^[:digit:]]" v) > (string-to-number v) > v))))) > + (when (string-prefix-p "/" host) > + (setq local t)) > > (mpc--debug "Connecting to %s:%s..." host port) > (with-current-buffer (get-buffer-create (format " *mpc-%s:%s*" host port)) > @@ -279,7 +282,10 @@ defaults to 6600 and HOST defaults to localhost." > (let* ((coding-system-for-read 'utf-8-unix) > (coding-system-for-write 'utf-8-unix) > (proc (condition-case err > - (open-network-stream "MPC" (current-buffer) host port) > + (make-network-process :name "MPC" :buffer (current-buffer) > + :host (unless local host) > + :service (if local host port) > + :family (if local 'local)) > (error (user-error (error-message-string err)))))) > (when (processp mpc-proc) > ;; Inherit the properties of the previous connection. I've been rolling with this patch for a while and have tested with mpd configured for socket and for port. Could this please be applied?