Permalink
Browse files

Introduce an ad-hoc treatment for url library on Emacs21 again.

This ensure that the sentinel for an redirect HTTP request, such as
asynchronous retrieval of icon images, works well.

* twittering-mode.el: Introduce an ad-hoc treatment for url
library on Emacs21 again. This ensure that the sentinel for an
redirect HTTP request, such as asynchronous retrieval of icon
images, works well.
(twittering-send-http-request): introduce an ad-hoc treatment for
the url library again. It is required because the process for a
redirected HTTP request is alive when the url library for Emacs21
invokes the callback.
(twittering-send-http-request-urllib): add an ad-hoc treatment for
HTTP redirection on Emacs21.
  • Loading branch information...
1 parent 3db31c3 commit e973e1903ffb592f336bbae2c876bf0f180c80cb @cvmat cvmat committed Nov 29, 2010
Showing with 19 additions and 1 deletion.
  1. +11 −0 ChangeLog
  2. +8 −1 twittering-mode.el
View
@@ -8,6 +8,17 @@
variable is not made buffer-local, the connection with redirection
may not be closed according to its global value.
+ * twittering-mode.el: Introduce an ad-hoc treatment for url
+ library on Emacs21 again. This ensures that the sentinel for an
+ redirect HTTP request, such as asynchronous retrieval of icon
+ images, works well.
+ (twittering-send-http-request): introduce an ad-hoc treatment for
+ the url library again. It is required because the process for a
+ redirected HTTP request is alive when the url library for Emacs21
+ invokes the callback.
+ (twittering-send-http-request-urllib): add an ad-hoc treatment for
+ HTTP redirection on Emacs21.
+
2010-11-27 Tadashi MATSUO <tad@mymail.twin.jp>
* twittering-mode.el: Fix a bug of retrieving a URI repeatedly.
View
@@ -1257,10 +1257,12 @@ The method to perform the request is determined from
request additional-info
(lambda (proc status-str connection-info)
(let ((status (cond
+ ((string= status-str "urllib-finished") 'exit)
((processp proc) (process-status proc))
(t nil)))
(buffer (process-buffer proc))
(exit-status (cond
+ ((string= status-str "urllib-finished") 0)
((processp proc) (process-exit-status proc))
(t 1)))
(command (process-command proc))
@@ -1748,7 +1750,12 @@ The method to perform the request is determined from
(lambda (&rest args)
(let ((proc url-http-process)
(url-buffer (current-buffer))
- (status-str "finished"))
+ (status-str
+ (if (and (< emacs-major-version 22)
+ (boundp 'url-http-end-of-headers)
+ url-http-end-of-headers)
+ "urllib-finished"
+ "finished")))
;; Callback may be called multiple times.
;; (as filter and sentinel?)
(unless (local-variable-if-set-p 'twittering-retrieved)

0 comments on commit e973e19

Please sign in to comment.