From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22160: 24.5; "M-x browse-url-emacs" on a 404 page Date: Sat, 19 Dec 2015 12:01:43 +0200 Message-ID: <83vb7uvjso.fsf@gnu.org> References: <871taqljji.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1450519347 24194 80.91.229.3 (19 Dec 2015 10:02:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Dec 2015 10:02:27 +0000 (UTC) Cc: 22160-done@debbugs.gnu.org To: Alex Kost Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 19 11:02:13 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 1aAEL5-0000Q0-5W for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Dec 2015 11:02:11 +0100 Original-Received: from localhost ([::1]:36731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAEL4-00047O-Az for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Dec 2015 05:02:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAEKz-00042c-Vb for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2015 05:02:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAEKw-0001Km-Gb for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2015 05:02:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAEKw-0001Kc-E5 for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2015 05:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aAEKw-0004PA-89 for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2015 05:02:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Dec 2015 10:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 22160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 22160@debbugs.gnu.org, eliz@gnu.org, alezost@gmail.com Original-Received: via spool by 22160-done@debbugs.gnu.org id=D22160.145051929016888 (code D ref 22160); Sat, 19 Dec 2015 10:02:02 +0000 Original-Received: (at 22160-done) by debbugs.gnu.org; 19 Dec 2015 10:01:30 +0000 Original-Received: from localhost ([127.0.0.1]:56244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aAEKQ-0004OK-0C for submit@debbugs.gnu.org; Sat, 19 Dec 2015 05:01:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40872) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aAEKO-0004O7-Rk for 22160-done@debbugs.gnu.org; Sat, 19 Dec 2015 05:01:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAEKG-0001Ed-Ch for 22160-done@debbugs.gnu.org; Sat, 19 Dec 2015 05:01:23 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAEKG-0001EV-99; Sat, 19 Dec 2015 05:01:20 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3398 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aAEKF-0002Hf-4c; Sat, 19 Dec 2015 05:01:19 -0500 In-reply-to: <871taqljji.fsf@gmail.com> (message from Alex Kost on Sun, 13 Dec 2015 13:39:13 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:110163 Archived-At: > From: Alex Kost > Date: Sun, 13 Dec 2015 13:39:13 +0300 > > Hello, I've noticed an unhandled error when I tried the following: > > 1. emacs -Q > 2. M-x browse-url-emacs RET http://hydra.gnu.org/build/12345 > > And the error is: > > find-file-noselect-1: Wrong type argument: arrayp, nil > > As (file-truename buffer-file-name) fails when buffer-file-name is nil. > > It would be good to have a more "friendly" error, like the one that > (url-insert-file-contents "http://hydra.gnu.org/build/12345") produces. browse-url-emacs is not supposed to display error messages for URLs that don't exist or cannot be accessed. That function is a fancy way of visiting a "file buffer" with the HTML source of the URL, so it should react like "C-x C-f" when the file does not exist. "C-x C-f" says "New file" and shows an empty buffer; browse-url-emacs's equivalent is IMO a buffer with the error returned by the server, in this case the standard 404 response. So this is what I did in commit bcf4913 on the emacs-25 branch. The previous code in url-insert-file-contents signaled an error when it received one of the 4xx responses, disregarding the VISIT argument, which was a mistake (introduced when we fixed bug#16733, where VISIT is nil). Now it follows more closely the behavior of insert-file-contents in that case. Thanks.