--- lisp/url/url-hanrlers.el~ 2017-01-04 22:17:18 +0000 +++ lisp/url/url-hanrlers.el 2017-02-21 00:36:20 +0000 @@ -339,23 +339,6 @@ (defun url-insert-file-contents (url &optional visit beg end replace) (let ((buffer (url-retrieve-synchronously url))) (unless buffer (signal 'file-error (list url "No Data"))) - (with-current-buffer buffer - ;; XXX: This is HTTP/S specific and should be moved to url-http - ;; instead. See http://debbugs.gnu.org/17549. - (when (bound-and-true-p url-http-response-status) - ;; Don't signal an error if VISIT is non-nil, because - ;; 'insert-file-contents' doesn't. This is required to - ;; support, e.g., 'browse-url-emacs', which is a fancy way of - ;; visiting the HTML source of a URL: in that case, we want to - ;; display a file buffer even if the URL does not exist and - ;; 'url-retrieve-synchronously' returns 404 or whatever. - (unless (or visit - (and (>= url-http-response-status 200) - (< url-http-response-status 300))) - (let ((desc (nth 2 (assq url-http-response-status url-http-codes)))) - (kill-buffer buffer) - ;; Signal file-error per http://debbugs.gnu.org/16733. - (signal 'file-error (list url desc)))))) (url-insert-buffer-contents buffer url visit beg end replace))) (put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents)