From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 3/3] lisp/mpc.el (mpc--proc-connect): use file-name-absolute-p Date: Mon, 7 Sep 2015 21:57:48 -0400 Message-ID: <20150908015748.GA995@holos> References: <1441668682-21988-1-git-send-email-mvoteiza@udel.edu> <1441668682-21988-3-git-send-email-mvoteiza@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1441677489 12348 80.91.229.3 (8 Sep 2015 01:58:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 01:58:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 08 03:58:00 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZZ8AZ-0004n2-RX for ged-emacs-devel@m.gmane.org; Tue, 08 Sep 2015 03:57:59 +0200 Original-Received: from localhost ([::1]:59573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ8AZ-0001Rl-Hw for ged-emacs-devel@m.gmane.org; Mon, 07 Sep 2015 21:57:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ8AV-0001Ra-HC for emacs-devel@gnu.org; Mon, 07 Sep 2015 21:57:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ8AQ-0007Lq-Is for emacs-devel@gnu.org; Mon, 07 Sep 2015 21:57:55 -0400 Original-Received: from mail-qg0-f52.google.com ([209.85.192.52]:35765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ8AQ-0007Lk-Ea for emacs-devel@gnu.org; Mon, 07 Sep 2015 21:57:50 -0400 Original-Received: by qgt47 with SMTP id 47so72137207qgt.2 for ; Mon, 07 Sep 2015 18:57:50 -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:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=O7DCPKHg+m8aeryhzFKAHKGidGnAxOLjUpi3j8vnKZo=; b=NkIe0rZ6fUBjDBDiOe94Irs9k+BztOVx6Q9Qz+BXNqY/SLvqCcNV55Dr2dcjNBXbtM lXuU2AabdVYJD4+FSRmvLNPIVc0xO11VgDpK5gwFNL2uo8J+xuPojwJlMGj0UxZS+16f PXoYg5OEKlg0hRoxGzWiqAqd0322j4aT16IUdtqFnlLtw1YeFFLQa4xA9QxtIkdR2TaK RqXWUawfExnfR7/IifTNcOqo4WcowTEP8MDFi6LoXgdP3p3+NyszVXWCVeNz18eBX5i4 BE+2o+5hbkQFbPBIDSve0UxBJTkMJcn3+Et3JVQeofrY0JBcv5o8vQCaVYiI+zP3BKnT X5Og== X-Gm-Message-State: ALoCoQnir+eqNyIFjP1pORxW8tHD5Y+yTaSgFLbzjVWDALAuzFD0NIVfVXzebJLeoFjrzTkWrBGs X-Received: by 10.140.231.211 with SMTP id b202mr33181334qhc.83.1441677469982; Mon, 07 Sep 2015 18:57:49 -0700 (PDT) Original-Received: from holos.localdomain (c-73-128-248-14.hsd1.md.comcast.net. [73.128.248.14]) by smtp.gmail.com with ESMTPSA id 103sm977513qkx.7.2015.09.07.18.57.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 18:57:49 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 60B3268971; Mon, 7 Sep 2015 21:57:48 -0400 (EDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+9 (2dac9fa02842) (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.52 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189693 Archived-At: On 07/09/15 at 09:16pm, Stefan Monnier wrote: > > - (when (string-prefix-p "/" host) ;FIXME: Use file-name-absolute-p? > > + (when (file-name-absolute-p host) > > + ;; Expand file name because `file-name-absolute-p' > > + ;; considers paths beginning with "~" as absolute > > + (setq host (expand-file-name host)) > > So do you think using file-name-absolute-p is better? > I left it as a FIXME, because I simply didn't know the answer. The only reasons I imagine it's better is because of readability and file_name_absolute_p has platform specifics. The latter reason is likely a silly one, regarding w32. > If you set $MPD_HOST to "~/.mpdsocket" do other MPD clients handle > it correctly? No, which is why I initially just did string-prefix-p. However, normally when one sets MPD_HOST in, for instance, a shell config e.g. export MPD_HOST=~/.mpdsocket the shell does the expansion of the ~ for us. No mpd client I know of (I've only tried mpc(1) and ncmpcpp) does tilde expansion. What the change is good for is letting someone set the defcustom mpc-host to the string "~/.mpdsocket" and it working, because Emacs is doing the tilde expansion. I think that file-name-absolute-p treating paths beginning with ~ as absolute is a little weird because it isn't really an absolute path, at least not until the tilde (or ~user/) is expanded into the path it represents. I figured I'd work with it, though. > What about under w32? I don't even know what the analog to UNIX domain sockets is on windows, if there is one.