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: Sun, 02 Aug 2015 17:47:35 -0400 Message-ID: <87a8u9mkg8.fsf@udel.edu> References: <87y4q7wkdc.fsf@udel.edu> <874mkhr0zu.fsf@udel.edu> <83h9ohv75m.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1438552105 19375 80.91.229.3 (2 Aug 2015 21:48:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 21:48:25 +0000 (UTC) To: 19394@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 02 23:48:11 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 1ZM175-0006ui-07 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 23:48:11 +0200 Original-Received: from localhost ([::1]:56884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM174-0005Ci-4C for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 17:48:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM16z-0005Cd-Vl for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM16w-0006w4-QC for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:48:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM16w-0006vt-O6 for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZM16w-0000fa-BY for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Aug 2015 21:48:02 +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.14385520682553 (code B ref -1); Sun, 02 Aug 2015 21:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Aug 2015 21:47:48 +0000 Original-Received: from localhost ([127.0.0.1]:37553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZM16i-0000f6-0t for submit@debbugs.gnu.org; Sun, 02 Aug 2015 17:47:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56765) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZM16e-0000ey-WA for submit@debbugs.gnu.org; Sun, 02 Aug 2015 17:47:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM16d-0006oR-Ut for submit@debbugs.gnu.org; Sun, 02 Aug 2015 17:47:44 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM16d-0006oN-SD for submit@debbugs.gnu.org; Sun, 02 Aug 2015 17:47:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM16c-0004aw-SX for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:47:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM16Z-0006nw-Kj for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:47:42 -0400 Original-Received: from mail-qg0-f44.google.com ([209.85.192.44]:36826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM16Z-0006nr-GO for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 17:47:39 -0400 Original-Received: by qgeh16 with SMTP id h16so77536068qge.3 for ; Sun, 02 Aug 2015 14:47:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=tNpNX8sAGJ8ciekju5IY+Ts14hsy+aN403nbeReB6EQ=; b=cL97bOr2FeemsBQ8XikJjNy3cHETZOyvgHny0h929YBkRVJz6L7SNhJ2alu17Kxli/ GjxR8Zfuq4TU1uRdeqJZZBFy56wrsPjcY7B9JW3EOrApqVzZtC7kZwJhj9JHOIMm+XUw Ifu2LgRpu/GB454bRDdPTLZq7WCJHZp4oiyapoDFBr7jqpMAjp/p2hWoJn2bVvMD9ZxF xzbm53449Jfzcgd1q8gVaJx34U0kQOisTUmTlZLaaM8F21UiqL6oaSf6v/N7tZ17pnfj hfRgvN9HDBNklaibhpxMXLMKihGEM0hLgWQhA0uLMpC5EJ6X1qFItSnO2kqitsEDwiz0 zy2w== X-Gm-Message-State: ALoCoQlEziWSFUKqEReloE3f9o0WtyTYt0KMbQ/dgZFXedhc2z+Ei5gTwTEzHD64klyEq7I7b7v8 X-Received: by 10.141.28.200 with SMTP id f191mr21882949qhe.52.1438552058377; Sun, 02 Aug 2015 14:47:38 -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 b71sm5887641qkh.17.2015.08.02.14.47.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 14:47:37 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id C9EC266ACA; Sun, 2 Aug 2015 17:47:35 -0400 (EDT) In-Reply-To: <83h9ohv75m.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 02 Aug 2015 22:09:57 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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: 140.186.70.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:105285 Archived-At: --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-mpc.el-mpc-proc-connect-support-UNIX-addresses-Bug-1.patch >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. -- 2.5.0 --=-=-=--