GNU bug report logs -
#5362
23.1.91; browse-url-of-dired-file vs. files::with::colons
Previous Next
Reported by: jidanni <at> jidanni.org
Date: Tue, 12 Jan 2010 01:09:02 UTC
Severity: minor
Tags: confirmed
Done: Andreas Schwab <schwab <at> linux-m68k.org>
Bug is archived. No further changes may be made.
Full log
Message #12 received at 5362 <at> debbugs.gnu.org (full text, mbox):
jidanni <at> jidanni.org writes:
> b runs the command browse-url-of-dired-file
> And when used on
> /tmp/WWW::Facebook::API.html
> it tried to browse
> ftp://tmp/WWW/:Facebook::API.html
>
> Say, aren't files always local files?
They are, so this is pretty nonsensical.
The culprit here is
(defun browse-url-file-url (file)
"Return the URL corresponding to FILE.
Use variable `browse-url-filename-alist' to map filenames to URLs."
(let ((coding (if (equal system-type 'windows-nt)
;; W32 pretends that file names are UTF-8 encoded.
'utf-8
(and (default-value 'enable-multibyte-characters)
(or file-name-coding-system
default-file-name-coding-system)))))
(if coding (setq file (encode-coding-string file coding))))
(setq file (browse-url-url-encode-chars file "[*\"()',=;?% ]"))
(dolist (map browse-url-filename-alist)
(when (and map (string-match (car map) file))
(setq file (replace-match (cdr map) t nil file))))
file)
(browse-url-file-url "/tmp/WWW::Facebook::API.html")
=> "ftp://tmp/WWW/:Facebook::API.html"
Which is wrong.
I don't quite understand why it does all this? Why doesn't it just
prepend "file://" to the file name? (Ok, it should probably do the
browse-url-url-encode-chars thing, anyway...)
Ideas?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 9 years and 148 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.