[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: paths are sensative to double separators

From: Stephen J. Turnbull
Subject: Re: paths are sensative to double separators
Date: Fri, 20 Mar 2009 14:48:44 +0900

Giorgos Keramidas writes:

 > > Which is rather uncommon and has an obvious, Emacs-wide solution: C-q /.
 > Unfortunately, quoting either slash of the double slash parts in
 > something like `C-x C-f /etc//foo' still restarts the search from the
 > filesystem root here

To me quoting the first slash would be a no-op, but quoting the second
slash should work.  But it does the same thing you observe in 22.1.1
here.  So I guess that's intentional.

I think it's astonishing that Emacs overrides the user's explicit
intent, and it should be changed.

 > I think if `C-x C-f /etc/ C-q / foo' really passed "/etc//foo" as
 > the file path name to the find-file function, it might be a nice
 > change that doesn't feel too surprising to someone who relies on
 > the current behavior.

I can't imagine anyone relies on having Emacs deliberately disobey
"/foo/" C-q "/" and convert it to "/".

Hm, interesting.  In the minibuffer, XEmacs takes C-q at its word, but
find-file (and completion) indeed converts "/foo/bar//" to "/".  This
is really ugly IMO.  I wonder what it takes to fix.  Interestingly,
"/etc/./foo" and "/etc/bar/../foo" work as expected, but both XEmacs
and Emacs 22.1.1 canonicalize the path to "/etc/foo".

N.B.  This matters if you want to use URLs, because not only do you
need the colon-double-slash to define the authority (which could be
special-cased in the function that canonicalizes paths, I guess), but
the RFCs don't define the semantics of double slash (and the Mercurial
URL hg://foo/bar means something different from hg://foo//bar).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]