From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Patch: file: -> file:/// in w32 Date: Sun, 19 Feb 2006 00:58:43 +0000 Message-ID: <43F7C2C3.4080809@gnu.org> References: <43F7ACDD.30203@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0844331312==" X-Trace: sea.gmane.org 1140311956 31759 80.91.229.2 (19 Feb 2006 01:19:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2006 01:19:16 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 19 02:19:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAdEB-0002LD-DP for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2006 02:19:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAdEA-0004uJ-QL for ged-emacs-devel@m.gmane.org; Sat, 18 Feb 2006 20:19:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FAcuY-0004EA-JB for emacs-devel@gnu.org; Sat, 18 Feb 2006 19:58:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FAcuW-0004Dt-SE for emacs-devel@gnu.org; Sat, 18 Feb 2006 19:58:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAcuW-0004Dp-AP for emacs-devel@gnu.org; Sat, 18 Feb 2006 19:58:48 -0500 Original-Received: from [213.86.207.50] (helo=exchange.integrasp.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FAd0C-0004Wb-WA for emacs-devel@gnu.org; Sat, 18 Feb 2006 20:04:41 -0500 Original-Received: from ASSP-nospam (localhost [127.0.0.1]) by exchange.integrasp.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id F1DFMNXG; Sun, 19 Feb 2006 00:52:44 -0000 Original-Received: from 83.67.23.108 ([83.67.23.108] helo=[10.0.0.30]) by ASSP-nospam ; 19 Feb 06 00:52:43 -0000 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: Lennart Borgman In-Reply-To: <43F7ACDD.30203@student.lu.se> 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:50742 Archived-At: This is a multi-part message in MIME format. --===============0844331312== Content-Type: multipart/alternative; boundary="------------070601010903050605040506" This is a multi-part message in MIME format. --------------070601010903050605040506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lennart Borgman wrote: > I believe a file url in w32 should begin with "file:///" not just > "file:". (I am unsure about ms-dos here.) A tiny patch is attached for > this. I think the condition used here is wrong. Instead of using system-type, we should test for the actual problem. The actual problem here is that an absolute filename does not start with /, so we need to prepend an extra one to make the URL local. I'm not sure that the current test is doing the right thing for cygwin, for instance, it may depend on some user setting whether the cygwin port uses cygwin paths or native windows paths here. > ------------------------------------------------------------------------ > > Index: lisp/net/browse-url.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/net/browse-url.el,v > retrieving revision 1.53 > diff -c -r1.53 browse-url.el > *** lisp/net/browse-url.el 6 Feb 2006 11:33:04 -0000 1.53 > --- lisp/net/browse-url.el 16 Feb 2006 23:38:42 -0000 > *************** > *** 458,464 **** > ;; applies. > ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "ftp://\\1\\2/") > (,@ (if (memq system-type '(windows-nt ms-dos cygwin)) > ! '(("^\\([a-zA-Z]:\\)[\\/]" . "file:\\1/") > ("^[\\/][\\/]+" . "file://")))) > ("^/+" . "file:/"))) > "*An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'. > --- 458,464 ---- > ;; applies. > ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "ftp://\\1\\2/") > (,@ (if (memq system-type '(windows-nt ms-dos cygwin)) > ! '(("^\\([a-zA-Z]:\\)[\\/]" . "file:///\\1/") > ("^[\\/][\\/]+" . "file://")))) > ("^/+" . "file:/"))) > "*An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'. > > ------------------------------------------------------------------------ > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel --------------070601010903050605040506 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lennart Borgman wrote:
I believe a file url in w32 should begin with "file:///" not just "file:". (I am unsure about ms-dos here.) A tiny patch is attached for this.
I think the condition used here is wrong. Instead of using system-type, we should test for the actual problem. The actual problem here is that an absolute filename does not start with /, so we need to prepend an extra one to make the URL local. I'm not sure that the current test is doing the right thing for cygwin, for instance, it may depend on some user setting whether the cygwin port uses cygwin paths or native windows paths here.



Index: lisp/net/browse-url.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/net/browse-url.el,v retrieving revision 1.53 diff -c -r1.53 browse-url.el *** lisp/net/browse-url.el 6 Feb 2006 11:33:04 -0000 1.53 --- lisp/net/browse-url.el 16 Feb 2006 23:38:42 -0000 *************** *** 458,464 **** ;; applies. ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "ftp://\\1\\2/") (,@ (if (memq system-type '(windows-nt ms-dos cygwin)) ! '(("^\\([a-zA-Z]:\\)[\\/]" . "file:\\1/") ("^[\\/][\\/]+" . "file://")))) ("^/+" . "file:/"))) "*An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'. --- 458,464 ---- ;; applies. ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "ftp://\\1\\2/") (,@ (if (memq system-type '(windows-nt ms-dos cygwin)) ! '(("^\\([a-zA-Z]:\\)[\\/]" . "file:///\\1/") ("^[\\/][\\/]+" . "file://")))) ("^/+" . "file:/"))) "*An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'.

_______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel

--------------070601010903050605040506-- --===============0844331312== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0844331312==--