emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch: file: -> file:/// in w32


From: Lennart Borgman
Subject: Re: Patch: file: -> file:/// in w32
Date: Sun, 19 Feb 2006 23:37:09 +0100
User-agent: Thunderbird 1.5 (Windows/20051201)

Jason Rumney wrote:
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.
I am not sure I understand you since I do not know the rules very well. Do you think that something like this would be better:


*** d:\eclean\bld\emacs\lisp\net\browse-url.el 2006-02-12 13:41:32.721715200 +0100
--- browse-url.el    2006-02-19 23:35:44.100412200 +0100
***************
*** 457,465 ****
     ;; it in anonymous cases.  If it's not anonymous the next regexp
     ;; applies.
     ("^/\\([^:@address@hidden)?\\([^:]+\\):/*" . "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'.
 Any substring of a filename matching one of the REGEXPs is replaced by
--- 457,465 ----
     ;; it in anonymous cases.  If it's not anonymous the next regexp
     ;; applies.
     ("^/\\([^:@address@hidden)?\\([^:]+\\):/*" . "ftp://\\1\\2/";)
+     ("^\\([^/]\\)" . "file:///\\1")
     (,@ (if (memq system-type '(windows-nt ms-dos cygwin))
!             '(("^[\\/][\\/]+" . "file://"))))
     ("^/+" . "file:/")))
   "*An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'.
 Any substring of a filename matching one of the REGEXPs is replaced by





reply via email to

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