From 65ee771cd2b362022cf4afcc9c0ff56b690ae781 Mon Sep 17 00:00:00 2001 From: Tadashi MATSUO Date: Sun, 26 Sep 2010 23:55:40 +0900 Subject: [PATCH] Add optional arguments to `twittering-send-http-request'. * twittering-mode.el: `twittering-send-http-request' receives optional arguments for connection method. (twittering-send-http-request): add two optional arguments for customizing connection method. --- ChangeLog | 5 +++++ twittering-mode.el | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2259e43..56532b87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,11 @@ from the given HTTP request alist. (twittering-start-http-session): do not bind `connection-info'. + * twittering-mode.el: `twittering-send-http-request' receives + optional arguments for connection method. + (twittering-send-http-request): add two optional arguments for + customizing connection method. + 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 e07a7401..c24ff10f 100644 --- a/twittering-mode.el +++ b/twittering-mode.el @@ -4292,16 +4292,26 @@ The parameter symbols are following: ,@additional ,@entry))) -(defun twittering-send-http-request (request additional-info sentinel) +(defun twittering-send-http-request (request additional-info sentinel &optional order table) "Open a connection and return a subprocess object for the connection. REQUEST must be an alist that has the same keys as that generated by `twittering-make-http-request'. SENTINEL is called as a function when the process changes state. It gets three arguments: the process, a string describing the change, and the connection-info, which is generated by `twittering-make-connection-info' -and also includes an alist ADDITIONAL-INFO." - (let* ((connection-info - (twittering-make-connection-info request additional-info)) +and also includes an alist ADDITIONAL-INFO. + +How to perform the request is selected from TABLE according to the priority +order ORDER. ORDER and TABLE are directly sent to +`twittering-make-connection-info'. +If ORDER is nil, `twittering-connection-type-order' is used in place of ORDER. +If TABLE is nil, `twittering-connection-type-table' is used in place of TABLE. +" + (let* ((order (or order twittering-connection-type-order)) + (table (or table twittering-connection-type-table)) + (connection-info + (twittering-make-connection-info request additional-info + order table)) (func (cdr (assq 'send-http-request connection-info))) (temp-buffer (generate-new-buffer "*twmode-http-buffer*"))) (when (and func (functionp func))