From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6339: url-filename => "/c:/some/file.txt" Date: Thu, 22 Sep 2011 00:31:09 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1316644318 28786 80.91.229.12 (21 Sep 2011 22:31:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Sep 2011 22:31:58 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , 6339@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 22 00:31:53 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VKb-0007Ff-GI for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Sep 2011 00:31:53 +0200 Original-Received: from localhost ([::1]:51716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VKa-0005hF-Nr for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Sep 2011 18:31:52 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VKX-0005gz-9m for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:31:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6VKT-0002B6-Tm for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:31:49 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VKT-0002B2-QR for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:31:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R6VKk-0003Fn-9y for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Sep 2011 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6339 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6339-submit@debbugs.gnu.org id=B6339.131664431012488 (code B ref 6339); Wed, 21 Sep 2011 22:32:02 +0000 Original-Received: (at 6339) by debbugs.gnu.org; 21 Sep 2011 22:31:50 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VKX-0003FM-Iz for submit@debbugs.gnu.org; Wed, 21 Sep 2011 18:31:50 -0400 Original-Received: from mail-fx0-f44.google.com ([209.85.161.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VKV-0003FE-Ar for 6339@debbugs.gnu.org; Wed, 21 Sep 2011 18:31:48 -0400 Original-Received: by fxd18 with SMTP id 18so1998051fxd.3 for <6339@debbugs.gnu.org>; Wed, 21 Sep 2011 15:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=yMtDYV8Uphj0zgm/++VwtaF4PZVE04Q+I27KhXxVg+A=; b=jwdJBnn/3tG48s8NAJAH9NTjuys3zEQKNYwPjknY0HyrhsqUZbZM4byKtJhKgAdfh+ pBFflJHn7ei7MNm9WqnDoNv88m20d0jSFHcwQsskh6XMIz9yyWkw/Z78jeAswUodaZPc DFqBss9HSHGY5HqaB/dGEm4v2jt20ei2a07qE= Original-Received: by 10.223.28.72 with SMTP id l8mr1760230fac.137.1316644289263; Wed, 21 Sep 2011 15:31:29 -0700 (PDT) Original-Received: by 10.152.20.229 with HTTP; Wed, 21 Sep 2011 15:31:09 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 21 Sep 2011 18:32:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:51618 Archived-At: On Thu, Sep 22, 2011 at 00:21, Juanma Barranquero wrote: > On Wed, Sep 21, 2011 at 22:28, Lars Magne Ingebrigtsen w= rote: > >> If I say: >> >> (setq x (url-generic-parse-url "file:///home/larsi/foo.txt")) >> >> Then I get >> >> (url-filename x) >> =3D> "/home/larsi/foo.txt" >> >> as expected. =C2=A0Would your patch break that? > > My patch would return "home/larsi/foo.txt", yes. > > But expecting the slash is a "bug" in you expectations, because the > *filename* (the path, according to the RFCs, see below) of > > =C2=A0file:///home/larsi/foo.txt > > is not "/home/larsi/foo.txt". The slash is a separator, part of the > URI syntax, and "home/larsi/foo.txt" is an absolute path. It's easier > to see it with the full syntax, in things like > > =C2=A0file://localhost/home/larsi/foo.txt > > for example. The fact that url-filename returns the slash is a bug; > just one that nobody has fixed or complained about because it makes > easier to process the path than having to do > > =C2=A0(concat "/" (url-filename "file:///mypath")) Are we not dealing with two different file name syntaxes here that just happens to look very similar? I.e. the URL file name syntax and the unix style file name syntax. url-filename is now returning the file name in unix style. This is, as you said, practical, but a bit surprising. I suspect there are some small mixing of those syntaxes elsewhere too. My suggestion would be to keep them and document them. > At least, until you have a Windows URI. And no, this is *not* a > Windows problem or a Windows bug, it's a bug that makes life easier > for POSIX at the cost of making it uglier for Windows. Indeed.