Skip to content

Commit

Permalink
Add optional arguments to `twittering-send-http-request'.
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
cvmat committed Sep 26, 2010
1 parent d1eeadb commit 65ee771
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -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 <tad@mymail.twin.jp>

* twittering-mode.el: Fix `twittering-push-uri-onto-kill-ring'.
Expand Down
18 changes: 14 additions & 4 deletions twittering-mode.el
Expand Up @@ -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))
Expand Down

0 comments on commit 65ee771

Please sign in to comment.