[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-w3m supports url "file:///c:/.../filename.html" but not "file://c:/../filename.html"
- From: victor ren <victor.ren@xxxxxxxxxxxx>
- Date: Tue, 17 Mar 2009 06:34:06 +0000 (UTC)
- X-ml-name: emacs-w3m
- X-mail-count: 10775
This is the first time I post here.
I test "file://c:/.../filename.html" with w3m, firefox and IE. All of them work.
But I got an error "Cannot retrieve URL: file://..." from emacs-w3m in Emacs.
I am using Emacs on Windows Vista.
I found the problem is in "w3m-url-to-file-name" in w3m.el.
This function cannot translate the two slashes URL into filename.
Below is an ugly fix to the problem.
*** 2721,2727 ****
whose net_loc part is not empty, a null string or the localhost name
to this function."
(cond
! ((string-match "\\`\\(\\(file:\\(//\\)?\\)\\|about://dtree\\)/" url)
(setq url (substring url (match-end 1)))
;; Strip the localhost name.
(when (and (match-beginning 2) ;; file:
--- 2721,2727 ----
whose net_loc part is not empty, a null string or the localhost name
to this function."
(cond
! ((string-match "\\`\\(\\(file:\\(/\\)\\{1,2\\}\\)\\|about://dtree\\)/" url)
(setq url (substring url (match-end 1)))
;; Strip the localhost name.
(when (and (match-beginning 2) ;; file: