From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Leo Liu <sdl.web@gmail.com>
Cc: 17549@debbugs.gnu.org
Subject: bug#17549: 24.4.50; regression: url-insert-file-contents
Date: Wed, 25 Jun 2014 22:38:37 -0400 [thread overview]
Message-ID: <jwvionoqtzp.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <m38uokikt6.fsf@gmail.com> (Leo Liu's message of "Thu, 26 Jun 2014 08:19:49 +0800")
> +(defconst url-http-codes)
This should use `defvar'.
> - (let ((response (url-http-parse-response)))
> - (if (and (>= response 200) (< response 300))
> - (goto-char (point-min))
> - (let ((desc (buffer-substring-no-properties (1+ (point))
> - (line-end-position))))
> + (when (bound-and-true-p url-http-response-status)
> + (unless (and (>= url-http-response-status 200)
> + (< url-http-response-status 300))
> + (let ((desc (nth 2 (assq url-http-response-status url-http-codes))))
IIUC the above just adds a "(when (bound-and-true-p
url-http-response-status)" wrapper around the existing code, right?
If so, it looks like a safe enough fix to install it in emacs-24.
This still doesn't look like The Right Way to do things in URL.
I think The Right Way would be for the url-http code to set some
backend-agnostic properties which url-handlers.el can then use.
Stefan
next prev parent reply other threads:[~2014-06-26 2:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 11:11 bug#17549: 24.4.50; regression: url-insert-file-contents Leo Liu
2014-05-29 23:24 ` Leo Liu
2014-05-30 2:09 ` Juanma Barranquero
2014-06-24 3:24 ` Leo Liu
2014-06-24 12:49 ` Stefan Monnier
2014-06-24 12:58 ` Juanma Barranquero
2014-06-24 13:38 ` Leo Liu
2014-06-24 14:01 ` Juanma Barranquero
2014-06-25 0:58 ` Leo Liu
2014-06-26 0:19 ` Leo Liu
2014-06-26 2:38 ` Stefan Monnier [this message]
2014-06-26 4:03 ` Leo Liu
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvionoqtzp.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=17549@debbugs.gnu.org \
--cc=sdl.web@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).