From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#2992: browse-url-of-file passes funny url to browser Date: Tue, 14 Apr 2009 19:59:41 +0900 Organization: Emacsen advocacy group Message-ID: Reply-To: Katsumi Yamaoka , 2992@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1239708264 9952 80.91.229.12 (14 Apr 2009 11:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Apr 2009 11:24:24 +0000 (UTC) Cc: emacs-w3m@namazu.org To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 14 13:25:43 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ltglq-0000us-32 for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Apr 2009 13:25:43 +0200 Original-Received: from localhost ([127.0.0.1]:45685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtgkR-0006TA-DL for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Apr 2009 07:24:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtgkB-0006Ho-Ex for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2009 07:23:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ltgk6-0006Eh-84 for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2009 07:23:58 -0400 Original-Received: from [199.232.76.173] (port=43602 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ltgk5-0006EU-Sz for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2009 07:23:53 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40063) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ltgk5-0004vT-6x for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2009 07:23:53 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3EBNoYp026453; Tue, 14 Apr 2009 04:23:50 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n3EB57eD021073; Tue, 14 Apr 2009 04:05:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Katsumi Yamaoka Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 14 Apr 2009 11:05:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2992 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123970680218716 (code B ref -1); Tue, 14 Apr 2009 11:05:07 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 14 Apr 2009 11:00:02 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3EAxwT4018675 for ; Tue, 14 Apr 2009 04:00:00 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:60537) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LtgMw-0005bp-9s for emacs-pretest-bug@gnu.org; Tue, 14 Apr 2009 06:59:58 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LtgMv-0000GM-G0 for emacs-pretest-bug@gnu.org; Tue, 14 Apr 2009 06:59:57 -0400 Original-Received: from orlando.hostforweb.net ([216.246.45.90]:47667) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LtgMu-0000G1-Sx for emacs-pretest-bug@gnu.org; Tue, 14 Apr 2009 06:59:57 -0400 Original-Received: from localhost ([127.0.0.1]:33769) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1LtgMr-0006Yx-1G; Tue, 14 Apr 2009 05:59:53 -0500 X-Hashcash: 1:20:090414:emacs-pretest-bug@gnu.org::99jxa24wuKFZ9Wn0:000000000000000000000000000000000000Cp8v X-Hashcash: 1:20:090414:emacs-w3m@namazu.org::SQZznlBTtnS6bYvv:00000000000000000000000000000000000000000AFsF X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (gnu/linux) Cancel-Lock: sha1:7IDIQq+0pjVg3oNR1TgCyIK9b3E= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 14 Apr 2009 07:23:58 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27160 Archived-At: 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 (("^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*" . "ftp://\\2/") ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "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,