all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alex Kost <alezost@gmail.com>
Cc: 22160-done@debbugs.gnu.org
Subject: bug#22160: 24.5; "M-x browse-url-emacs" on a 404 page
Date: Sat, 19 Dec 2015 12:01:43 +0200	[thread overview]
Message-ID: <83vb7uvjso.fsf@gnu.org> (raw)
In-Reply-To: <871taqljji.fsf@gmail.com> (message from Alex Kost on Sun, 13 Dec 2015 13:39:13 +0300)

> From: Alex Kost <alezost@gmail.com>
> 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.





      reply	other threads:[~2015-12-19 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13 10:39 bug#22160: 24.5; "M-x browse-url-emacs" on a 404 page Alex Kost
2015-12-19 10:01 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83vb7uvjso.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22160-done@debbugs.gnu.org \
    --cc=alezost@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.