From: ueno Date: Wed, 6 Jun 2007 09:07:31 +0000 (+0000) Subject: * riece-twitter.el (riece-twitter-sentinel): New function. X-Git-Tag: riece-5_0_0~47 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=cf84c926f8a5c65fcca630a41645e53b9a5f148c;p=elisp%2Friece.git * riece-twitter.el (riece-twitter-sentinel): New function. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a4ca687..bdebb66 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,7 @@ * riece-twitter.el (riece-twitter-set-credential): New command. (riece-twitter-update): New command. (riece-twitter-message-filter): Use it. + (riece-twitter-sentinel): New function. 2007-06-05 Daiki Ueno diff --git a/lisp/riece-twitter.el b/lisp/riece-twitter.el index 84e7722..9726069 100644 --- a/lisp/riece-twitter.el +++ b/lisp/riece-twitter.el @@ -60,18 +60,27 @@ (defun riece-twitter-update (status) "Update your status." (interactive "sStatus: ") - (start-process - "curl" nil "curl" - "-H" "X-Twitter-Client: Riece" - "-H" (concat "X-Twitter-Client-Version: " riece-version-number) - "-H" "X-Twitter-Client-URL: http://riece.nongnu.org/twitter.xml" - "-u" credential - "-d" "source=riece" - "-d" (concat "status=" - (riece-twitter-escape-string - (encode-coding-string status 'utf-8))) - "-s" - "http://twitter.com/statuses/update.json")) + (message "Sending to Twitter...") + (let ((process + (start-process + "curl" nil "curl" + "-H" "X-Twitter-Client: Riece" + "-H" (concat "X-Twitter-Client-Version: " riece-version-number) + "-H" "X-Twitter-Client-URL: http://riece.nongnu.org/twitter.xml" + "-u" credential + "-d" "source=riece" + "-d" (concat "status=" + (riece-twitter-escape-string + (encode-coding-string status 'utf-8))) + "-s" + "http://twitter.com/statuses/update.json"))) + (set-process-sentinel process #'riece-twitter-sentinel))) + +(defun riece-twitter-sentinel (process status) + (if (equal status "finished\n") + (message "Sending to Twitter...done") + (message "Sending to Twitter...failed: %s" + (substring status 0 (1- (length status)))))) (defun riece-twitter-message-filter (message) (if (and (riece-message-own-p message)