Skip to content

Commit

Permalink
Put the URL on the last in arguments for `curl'.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-start-http-session-curl): modify
the order of arguments for `curl', where the URL is placed last.
  • Loading branch information
cvmat committed Mar 29, 2010
1 parent 2ff4ea3 commit 4acfffc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 31 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -14,6 +14,9 @@
* twittering-mode.el (twittering-update-status-from-minibuffer):
fix infinite loop on updating a status from minibuffer.

* twittering-mode.el (twittering-start-http-session-curl): modify
the order of arguments for `curl', where the URL is placed last.

2010-03-25 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-get-status-url): change the
Expand Down
53 changes: 22 additions & 31 deletions twittering-mode.el
Expand Up @@ -1831,37 +1831,28 @@ Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
(curl-args
`("--include" "--silent"
,@(mapcan (lambda (pair)
(list "-H"
(format "%s: %s"
(car pair) (cdr pair))))
headers))))
(when twittering-use-ssl
(nconc curl-args `("--cacert" ,(twittering-ensure-ca-cert))))
(when twittering-proxy-use
(nconc curl-args `("-x" ,(format "%s:%s" twittering-proxy-server
twittering-proxy-port)))
(when (and twittering-proxy-user
twittering-proxy-password)
(nconc curl-args `("-U" ,(format "%s:%s" twittering-proxy-user
twittering-proxy-password)))))

(flet ((request (key)
(funcall request key)))
(nconc curl-args `(,(if parameters
(concat (request :uri) "?"
(request :query-string))
(request :uri))))
(when (string= "POST" method)
(nconc curl-args
`(,@(mapcan (lambda (pair)
(list
"-d"
(format "%s=%s"
(twittering-percent-encode
(car pair))
(twittering-percent-encode
(cdr pair)))))
parameters)))))
`("-H" ,(format "%s: %s" (car pair) (cdr pair))))
headers)
,@(when twittering-use-ssl
`("--cacert" ,(twittering-ensure-ca-cert)))
,@(when twittering-proxy-use
`("-x" ,(format "%s:%s" twittering-proxy-server
twittering-proxy-port)))
,@(when (and twittering-proxy-use
twittering-proxy-user twittering-proxy-password)
`("-U" ,(format "%s:%s" twittering-proxy-user
twittering-proxy-password)))
,@(when (string= "POST" method)
(mapcan (lambda (pair)
(list
"-d"
(format "%s=%s"
(twittering-percent-encode (car pair))
(twittering-percent-encode (cdr pair)))))
parameters))
,(concat (funcall request :uri)
(when parameters
(concat "?" (funcall request :query-string)))))))
(debug-print curl-args)
(lexical-let ((noninteractive noninteractive)
(sentinel sentinel))
Expand Down

0 comments on commit 4acfffc

Please sign in to comment.