all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark Oteiza <mvoteiza@udel.edu>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <20150908015748.GA995@holos> (raw)
In-Reply-To: <jwvh9n5btmw.fsf-monnier+emacs@gnu.org>

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.



      reply	other threads:[~2015-09-08  1:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07 23:31 [PATCH 1/3] lisp/mpc.el (mpc-file-local-copy): check more config locations Mark Oteiza
2015-09-07 23:31 ` [PATCH 2/3] lisp/mpc.el (mpc-file-local-copy): check for absolute path Mark Oteiza
2015-09-07 23:31 ` [PATCH 3/3] lisp/mpc.el (mpc--proc-connect): use file-name-absolute-p Mark Oteiza
2015-09-08  1:16   ` Stefan Monnier
2015-09-08  1:57     ` Mark Oteiza [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150908015748.GA995@holos \
    --to=mvoteiza@udel.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.