From ab2950a146bbd5290aaf585a042c6eae2affa6f0 Mon Sep 17 00:00:00 2001 From: Vivek Haldar Date: Fri, 17 Dec 2010 03:20:18 -0800 Subject: [PATCH] twittering-update-status-from-minibuffer --- twittering-mode.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/twittering-mode.el b/twittering-mode.el index 8fc2ef4c..4b0646e0 100644 --- a/twittering-mode.el +++ b/twittering-mode.el @@ -6387,6 +6387,17 @@ been initialized yet." (re-search-forward "\\`[[:space:]]*@[a-zA-Z0-9_-]+\\([[:space:]]+@[a-zA-Z0-9_-]+\\)*" nil t) (re-search-forward "[^[:space:]]" nil t))) +(defun twittering-update-status-from-region () + (interactive) + (let ((status (buffer-substring (region-beginning) (region-end)))) + (if (< 140 (length status)) + (message "Status too long, not posting.") + (when (twittering-status-not-blank-p status) + (twittering-call-api + 'update-status + `((status . ,status))) + (message (concat "Posted status: " status)))))) + (defun twittering-update-status-from-minibuffer (&optional init-str reply-to-id username spec) (and (not (twittering-timeline-spec-is-direct-messages-p spec)) (null init-str)