unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch: file: -> file:/// in w32
@ 2006-02-18 23:25 Lennart Borgman
  2006-02-19  0:58 ` Jason Rumney
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2006-02-18 23:25 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 144 bytes --]

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.

[-- Attachment #2: browse-url-file.patch --]
[-- Type: text/plain, Size: 1041 bytes --]

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'.

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: file: -> file:/// in w32
  2006-02-18 23:25 Patch: file: -> file:/// in w32 Lennart Borgman
@ 2006-02-19  0:58 ` Jason Rumney
  2006-02-19 22:37   ` Lennart Borgman
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Rumney @ 2006-02-19  0:58 UTC (permalink / raw)
  Cc: Emacs Devel


[-- Attachment #1.1: Type: text/plain, Size: 2020 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 2955 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: file: -> file:/// in w32
  2006-02-19  0:58 ` Jason Rumney
@ 2006-02-19 22:37   ` Lennart Borgman
  0 siblings, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2006-02-19 22:37 UTC (permalink / raw)
  Cc: Emacs Devel

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.
      ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "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.
      ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-19 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-18 23:25 Patch: file: -> file:/// in w32 Lennart Borgman
2006-02-19  0:58 ` Jason Rumney
2006-02-19 22:37   ` Lennart Borgman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).