From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#5362: 23.1.91; browse-url-of-dired-file vs. files::with::colons Date: Fri, 25 Dec 2015 23:15:08 +0100 Message-ID: <8737uqxjir.fsf@gnus.org> References: <87iqb8le7x.fsf@jidanni.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1451081782 2946 80.91.229.3 (25 Dec 2015 22:16:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Dec 2015 22:16:22 +0000 (UTC) Cc: 5362@debbugs.gnu.org To: jidanni@jidanni.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 25 23:16:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aCaef-000320-UR for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Dec 2015 23:16:10 +0100 Original-Received: from localhost ([::1]:36626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCaef-0008Gh-5M for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Dec 2015 17:16:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCaeb-0008GY-A8 for bug-gnu-emacs@gnu.org; Fri, 25 Dec 2015 17:16:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCaeY-0004D4-3U for bug-gnu-emacs@gnu.org; Fri, 25 Dec 2015 17:16:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCaeY-0004D0-0f for bug-gnu-emacs@gnu.org; Fri, 25 Dec 2015 17:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aCaeX-0007ro-U7 for bug-gnu-emacs@gnu.org; Fri, 25 Dec 2015 17:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Dec 2015 22:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5362 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 5362-submit@debbugs.gnu.org id=B5362.145108173328372 (code B ref 5362); Fri, 25 Dec 2015 22:16:01 +0000 Original-Received: (at 5362) by debbugs.gnu.org; 25 Dec 2015 22:15:33 +0000 Original-Received: from localhost ([127.0.0.1]:35704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCae5-0007NH-B8 for submit@debbugs.gnu.org; Fri, 25 Dec 2015 17:15:33 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:38992) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCae3-0007KC-6t for 5362@debbugs.gnu.org; Fri, 25 Dec 2015 17:15:31 -0500 Original-Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aCadh-0005G3-Q4; Fri, 25 Dec 2015 23:15:09 +0100 In-Reply-To: <87iqb8le7x.fsf@jidanni.org> (jidanni@jidanni.org's message of "Tue, 12 Jan 2010 01:54:10 +0800") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aCadh-0005G3-Q4 MailScanner-NULL-Check: 1451686510.13725@3CaVb+Gc6LLnkR1K5tp4xw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:110473 Archived-At: jidanni@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