From d2e8ac7557ed4b64bfdffd20657cf5568ca11ea5 Mon Sep 17 00:00:00 2001 From: Tadashi MATSUO Date: Sun, 26 Sep 2010 23:56:43 +0900 Subject: [PATCH] Transfer sentinel functions via `connection-info'. * twittering-mode.el: Transfer sentinel functions to `twittering-default-sentinel' via `connection-info'. (twittering-start-http-session): transfer the variable `sentinel' to `twittering-http-default-sentinel' via `connection-info'. (twittering-http-default-sentinel): remove the arguments `func' and `clean-up-sentinel'. The sentinel functions are retrieved from `connection-info'. --- ChangeLog | 8 ++++++++ twittering-mode.el | 17 ++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 409012c3..0dc25530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,14 @@ (twittering-ensure-connection-method): take account of `twittering-oauth-use-ssl'. + * twittering-mode.el: Transfer sentinel functions to + `twittering-default-sentinel' via `connection-info'. + (twittering-start-http-session): transfer the variable `sentinel' + to `twittering-http-default-sentinel' via `connection-info'. + (twittering-http-default-sentinel): remove the arguments `func' + and `clean-up-sentinel'. The sentinel functions are retrieved from + `connection-info'. + 2010-09-19 Tadashi MATSUO * twittering-mode.el: Fix `twittering-push-uri-onto-kill-ring'. diff --git a/twittering-mode.el b/twittering-mode.el index b889c857..094334e8 100644 --- a/twittering-mode.el +++ b/twittering-mode.el @@ -4334,14 +4334,11 @@ CLEAN-UP-SENTINEL: sentinel always executed." (twittering-make-http-request method headers host port path parameters post-body twittering-use-ssl)) - (additional-info `((noninteractive . ,noninteractive)))) - (lexical-let ((clean-up-sentinel clean-up-sentinel) - (sentinel sentinel)) - (twittering-send-http-request - request additional-info - (lambda (&rest args) - (apply #'twittering-http-default-sentinel - sentinel clean-up-sentinel args)))))) + (additional-info `((noninteractive . ,noninteractive) + (clean-up-sentinel . ,clean-up-sentinel) + (sentinel . ,sentinel)))) + (twittering-send-http-request request additional-info + #'twittering-http-default-sentinel))) (defvar twittering-cert-file nil) @@ -4609,12 +4606,14 @@ QUERY-PARAMETERS is a list of cons pair of name and value such as (+ (* (car encoded-time) 65536) (cadr encoded-time)))) -(defun twittering-http-default-sentinel (func clean-up-sentinel proc stat connection-info &optional suc-msg) +(defun twittering-http-default-sentinel (proc stat connection-info &optional suc-msg) (debug-printf "http-default-sentinel: proc=%s stat=%s exit-status=%s" proc stat (process-exit-status proc)) (let ((temp-buffer (process-buffer proc)) (status (process-status proc)) (exit-status (process-exit-status proc)) (authorization-queried (twittering-account-authorization-queried-p)) + (func (cdr (assq 'sentinel connection-info))) + (clean-up-sentinel (cdr (assq 'clean-up-sentinel connection-info))) (noninteractive (cdr (assq 'noninteractive connection-info))) (mes nil)) (cond