From c431782a8f156d15c3f6c6eda3faedf0f3d2e9a8 Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 13 Oct 2007 10:17:55 +0000 Subject: [PATCH] (riece-twitter-update): Don't send extra headers only if it is called interactively. --- lisp/ChangeLog | 5 +++++ lisp/riece-twitter.el | 31 ++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a5510f..f0eceee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-13 Daiki Ueno + + * riece-twitter.el (riece-twitter-update): Don't send extra + headers only if it is called interactively. + 2007-10-12 Daiki Ueno * riece-twitter.el (riece-twitter-update): Don't send extra headers. diff --git a/lisp/riece-twitter.el b/lisp/riece-twitter.el index a88330d..a227cbb 100644 --- a/lisp/riece-twitter.el +++ b/lisp/riece-twitter.el @@ -67,19 +67,24 @@ "\\[riece-twitter-set-credential] to set your credential"))) (list (read-string "Status: ")))) (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" riece-twitter-credential -;; "-d" "source=riece" - "-d" (concat "status=" - (riece-twitter-escape-string - (encode-coding-string status 'utf-8))) - "-s" - "http://twitter.com/statuses/update.json"))) + (let* ((args + (list "-u" riece-twitter-credential + "-d" (concat "status=" + (riece-twitter-escape-string + (encode-coding-string status 'utf-8))) + "-s" + "http://twitter.com/statuses/update.json")) + (process + (apply #'start-process + "curl" nil "curl" + (if (interactive-p) + args + (append args + (list "-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" + "-d" "source=riece")))))) (set-process-sentinel process #'riece-twitter-sentinel))) (defun riece-twitter-sentinel (process status) -- 1.7.10.4