bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#2992: marked as done (browse-url-of-file passes funny url to browse


From: Emacs bug Tracking System
Subject: bug#2992: marked as done (browse-url-of-file passes funny url to browser)
Date: Wed, 15 Apr 2009 23:00:03 +0000

Your message dated Wed, 15 Apr 2009 18:54:21 -0400
with message-id <address@hidden>
and subject line Re: browse-url-of-file passes funny url to browser
has caused the Emacs bug report #2992,
regarding browse-url-of-file passes funny url to browser
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact address@hidden
immediately.)


-- 
2992: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2992
Emacs Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: browse-url-of-file passes funny url to browser Date: Tue, 14 Apr 2009 19:59:41 +0900 User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (gnu/linux)
Hi,

`browse-url-of-file' performed for a local file passes a funny
url to the browser.  So do `browse-url-of-dired-file' and
`browse-url-of-buffer'.  For instance:

(let* (result
       (browse-url-browser-function (lambda (url &optional arg)
                                      (setq result url))))
  (browse-url-of-file "/some/where/index.html")
  result)
 => "file:/some/where/index.html"

Some browsers (e.g. Firefox) work with such a url but others
(e.g. emacs-w3m) don't.  It is due to the last item of the default
value of `browse-url-filename-alist':

--8<---------------cut here---------------start------------->8---
browse-url-filename-alist is a variable defined in `browse-url.el'.
Its value is
(("^/\\(address@hidden|address@hidden)?\\([^:]+\\):/*" . "ftp://\\2/";)
 ("^/\\([^:@address@hidden)?\\([^:]+\\):/*" . "ftp://\\1\\2/";)
 ("^/+" . "file:/"))
--8<---------------cut here---------------end--------------->8---

I believe it should be ("^/+" . "file:///").  Does anyone know
any harm with this change?

--8<---------------cut here---------------start------------->8---
*** browse-url.el~      Mon Jan  5 03:22:43 2009
--- browse-url.el       Tue Apr 14 10:57:43 2009
***************
*** 446,452 ****
      ,@(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
  the corresponding STRING using `replace-match', not treating STRING
--- 446,452 ----
      ,@(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
  the corresponding STRING using `replace-match', not treating STRING
--8<---------------cut here---------------end--------------->8---

Regards,



--- End Message ---
--- Begin Message --- Subject: Re: browse-url-of-file passes funny url to browser Date: Wed, 15 Apr 2009 18:54:21 -0400
> `browse-url-of-file' performed for a local file passes a funny url to
> the browser.Some browsers (e.g. Firefox) work with such a url but others
> (e.g. emacs-w3m) don't.  It is due to the last item of the default value
> of `browse-url-filename-alist':
>
> I believe it should be ("^/+" . "file:///").  Does anyone know
> any harm with this change?

No, I think it's correct.  I've committed your patch, thanks.


--- End Message ---

reply via email to

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