From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: paths are sensative to double separators Date: Fri, 20 Mar 2009 14:48:44 +0900 Message-ID: <87ocvwsq0z.fsf@xemacs.org> References: <20090319015037.GC6695@reforged> <87skl97og1.fsf@kobe.laptop> <87prgdsigb.fsf@xemacs.org> <87tz5p5xyo.fsf@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237527691 18914 80.91.229.12 (20 Mar 2009 05:41:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2009 05:41:31 +0000 (UTC) Cc: xah@xahlee.org, Mike Mattie , emacs-devel@gnu.org To: Giorgos Keramidas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 20 06:42:47 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LkXV5-00052U-OX for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2009 06:42:36 +0100 Original-Received: from localhost ([127.0.0.1]:47318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkXTj-0002Ku-Ad for ged-emacs-devel@m.gmane.org; Fri, 20 Mar 2009 01:41:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkXTe-0002Kp-Og for emacs-devel@gnu.org; Fri, 20 Mar 2009 01:41:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkXTa-0002KN-8J for emacs-devel@gnu.org; Fri, 20 Mar 2009 01:41:06 -0400 Original-Received: from [199.232.76.173] (port=55834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkXTa-0002KK-64 for emacs-devel@gnu.org; Fri, 20 Mar 2009 01:41:02 -0400 Original-Received: from mtps02.sk.tsukuba.ac.jp ([130.158.97.224]:52574) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LkXTZ-0006vg-MD for emacs-devel@gnu.org; Fri, 20 Mar 2009 01:41:01 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps02.sk.tsukuba.ac.jp (Postfix) with ESMTP id B34917FFA; Fri, 20 Mar 2009 14:40:51 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 50A3C1A2F2B; Fri, 20 Mar 2009 14:48:44 +0900 (JST) In-Reply-To: <87tz5p5xyo.fsf@kobe.laptop> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta28) "fuki" 83e35df20028+ XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109712 Archived-At: 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).