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 14:36:37 -0400 Message-ID: <874mkhr0zu.fsf@udel.edu> References: <87y4q7wkdc.fsf@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1438540643 21775 80.91.229.3 (2 Aug 2015 18:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 18:37:23 +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 20:37: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 1ZLy8F-00006V-7D for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 20:37:11 +0200 Original-Received: from localhost ([::1]:56600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLy8E-0005hJ-E3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 14:37:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLy8A-0005hC-C6 for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:37:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLy86-0003Bd-Bj for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:37:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLy86-0003BY-7v for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZLy85-0004Jw-ND for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:37:01 -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 18:37:01 +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.143854061016589 (code B ref -1); Sun, 02 Aug 2015 18:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Aug 2015 18:36:50 +0000 Original-Received: from localhost ([127.0.0.1]:37496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLy7t-0004JV-Jc for submit@debbugs.gnu.org; Sun, 02 Aug 2015 14:36:50 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60222) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLy7q-0004JM-8m for submit@debbugs.gnu.org; Sun, 02 Aug 2015 14:36:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLy7p-0003Ai-2g for submit@debbugs.gnu.org; Sun, 02 Aug 2015 14:36:45 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:59556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLy7o-0003Ae-Vi for submit@debbugs.gnu.org; Sun, 02 Aug 2015 14:36:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLy7n-0005ca-Sf for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:36:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLy7j-00038w-RG for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:36:43 -0400 Original-Received: from mail-qg0-f51.google.com ([209.85.192.51]:36090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLy7j-00038c-Mw for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2015 14:36:39 -0400 Original-Received: by qgeh16 with SMTP id h16so76047778qge.3 for ; Sun, 02 Aug 2015 11:36:39 -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:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=AsM3ygweT6l/Ymxj5NA/dPGza9lSAWSGlPS3BTpkWHM=; b=BpTMPUiTAZsx57YT3Ega1M20iKvAHlaCMBOYZbau+aQSbXEO1Db0ntVv2inNJG94f1 g5bQb2bI/0uitU+IiD1dXRj9wWh2Ojbl+CPVqhe9+rMR4K6wN40mZTHgiHgaO800p9Yz tA5t5luICU6F2xR/lyXNavhC65mns4PGdyvE5PVyy3p4VJxxqy3anzqc4zV+n8LoGGuG POhvRb0YWCF55lWO/ChEj6bKsulCMTey93lqQ0PLWJ0bXZAWuDJU1P7mNhq1b7dpZb5g VWsVOV+Ai3V6T6Y0ayGN8/ct8VyZc0QJcy1tAAVWp8Tsg7Igw7JGzJIhQeX1vGyQlpyK +ifA== X-Gm-Message-State: ALoCoQlJZrL/SvtgQpB9n4Xilnjz1QA2BAgtFeMTBEtkYgcksjffRD5bBw+tM9b3Nsu19u9h8R6m X-Received: by 10.140.239.84 with SMTP id k81mr21276471qhc.66.1438540599097; Sun, 02 Aug 2015 11:36:39 -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 f71sm5614786qhe.7.2015.08.02.11.36.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 11:36:38 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id B07D866ACA; Sun, 2 Aug 2015 14:36:37 -0400 (EDT) In-Reply-To: <87y4q7wkdc.fsf@udel.edu> (Mark Oteiza's message of "Tue, 16 Dec 2014 12:54:39 -0500") 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:105281 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark Oteiza writes: > mpc.el treats MPD_HOST only as an address or hostname, when it can also > be a socket. So, doing =E2=80=98M-x mpc RET=E2=80=99 here gives > > /run/user/1000/mpd/socket/6600 Name or service not known > >>>From the mpd manual: > > bind_to_address > This specifies which address mpd binds to and listens on. > Multiple bind_to_address parameters may be specified. The > default is "any", which binds to all available addresses. > > You can set a port that is different from the global port > setting, e.g. "localhost:6602". IPv6 addresses must be > enclosed in square brackets if you want to configure a > port, e.g. "[::1]:6602". > > To bind to a Unix domain socket, specify an absolute path > or a path starting with a tilde (~). For a system-wide > MPD, we suggest the path "/var/run/mpd/socket". > > =E2=80=98bind_to_address=E2=80=99 is the mpd config option corresponding = to MPD_HOST. Here's a patch for handling the MPD_HOST being a socket. I don't really get the wording "or a path starting with a tilde (~)." because no mpd clients that I have (mpc, ncmpcpp) actually do tilde expansion themselves, so I ignored that case. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-mpc.el-mpc-proc-connect-attempt-socket-connection-if.patch >From 706b3c005aac0d3b606b4265c315bdd3bc6d1a5a Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Sat, 1 Aug 2015 00:46:02 -0400 Subject: [PATCH] mpc.el (mpc--proc-connect): attempt socket connection if host is an absolute path (Bug#19394) --- lisp/mpc.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/mpc.el b/lisp/mpc.el index 76c08db..4d04cf8 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -279,7 +279,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 host :service port + :remote (if (string-prefix-p "/" host) + host)) (error (user-error (error-message-string err)))))) (when (processp mpc-proc) ;; Inherit the properties of the previous connection. -- 2.5.0 --=-=-=--