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

emacs-w3m supports url "file:///c:/.../filename.html" but not "file://c:/../filename.html"



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: