Permalink
Browse files

Enable to toggle a reply and a normal tweet on an edit buffer.

* twittering-mode.el: Enable to toggle a reply and a normal tweet
on an edit buffer.
(twittering-edit-mode-map): bind "C-c C-r" to
`twittering-edit-toggle-reply'.
(twittering-edit-setup-help): display a help for
`twittering-edit-toggle-reply'.
(twittering-edit-toggle-reply): new function, which toggles
whether the tweet being edited will be sent as a reply or not.
  • Loading branch information...
1 parent 7e35a11 commit 0306e1d46b5b42f0b2582a8a045ff1fd437e31f9 @cvmat cvmat committed Feb 27, 2012
Showing with 42 additions and 0 deletions.
  1. +9 −0 ChangeLog
  2. +4 −0 NEWS
  3. +5 −0 NEWS.ja
  4. +24 −0 twittering-mode.el
View
@@ -113,6 +113,15 @@
(twittering-update-status-from-pop-up-buffer): remove obsolete
arguments from the invocation of `twittering-edit-setup-help'.
+ * twittering-mode.el: Enable to toggle a reply and a normal tweet
+ on an edit buffer.
+ (twittering-edit-mode-map): bind "C-c C-r" to
+ `twittering-edit-toggle-reply'.
+ (twittering-edit-setup-help): display a help for
+ `twittering-edit-toggle-reply'.
+ (twittering-edit-toggle-reply): new function, which toggles
+ whether the tweet being edited will be sent as a reply or not.
+
2012-02-12 Tadashi MATSUO <tad@mymail.twin.jp>
* twittering-mode.el: Accept a symbol as FUNC of a composite
View
4 NEWS
@@ -184,6 +184,10 @@
buffer. Which the tweet is a reply, a direct message or an
independent ordinary tweet is explicitly displayed. You can also
copy the tweet being replied.
+* Switch of a reply and a normal tweet on a pop-up edit buffer.
+ You can toggle whether the tweet being edited will be sent as a
+ reply or a normal tweet by invoking `twittering-edit-toggle-reply'
+ bound to "C-c C-r" in default.
### Bug fixes
* Fix of displaying a message of authorization.
View
@@ -180,6 +180,11 @@
りました。編集中のtweetがreplyなのか、direct messageなのか、あるいは
通常のtweetなのかが確認できます。reply先のtweet内容のコピーもできま
す。
+* 編集中のtweetをreplyとして送るかどうかの切り替え
+ 編集中のtweetをreplyとして送るかどうかを編集バッファ上で切り替えられ
+ るようになりました。関数`twittering-edit-toggle-reply'(デフォルトでは
+ "C-c C-r"にbindされています)を呼ぶたびにreplyとして送るかどうかが切
+ り替わります。
### バグ修正
* 認証成功・失敗についてのメッセージが表示されるよう修正
View
@@ -8519,6 +8519,7 @@ entry in `twittering-edit-skeleton-alist' are performed.")
(let ((km twittering-edit-mode-map))
(define-key km (kbd "C-c C-c") 'twittering-edit-post-status)
(define-key km (kbd "C-c C-k") 'twittering-edit-cancel-status)
+ (define-key km (kbd "C-c C-r") 'twittering-edit-toggle-reply)
(define-key km (kbd "M-n") 'twittering-edit-next-history)
(define-key km (kbd "M-p") 'twittering-edit-previous-history)
(define-key km (kbd "<f4>") 'twittering-edit-replace-at-point)))
@@ -8652,6 +8653,7 @@ instead."
,(propertize (format (substitute-command-keys "Keymap:
\\[twittering-edit-post-status]: send %s
\\[twittering-edit-cancel-status]: cancel %s
+ \\[twittering-edit-toggle-reply]: toggle a normal tweet and a reply.
\\[twittering-edit-next-history]: next history element
\\[twittering-edit-previous-history]: previous history element
\\[twittering-edit-replace-at-point]: shorten URL at point
@@ -8806,6 +8808,28 @@ Pairs of a key symbol and an associated value are following:
(twittering-tinyurl-replace-at-point)
(twittering-edit-length-check)))
+(defun twittering-edit-toggle-reply ()
+ "Toggle whether the tweet being edited will be sent as a reply or not."
+ (interactive)
+ (let ((tweet-type (cdr (assq 'tweet-type twittering-edit-mode-info)))
+ (cited-id (cdr (assq 'cited-id twittering-edit-mode-info))))
+ (cond
+ ((eq tweet-type 'direct-message)
+ (message "The current message is a direct message."))
+ ((null cited-id)
+ (message "The current message does not have a reply target."))
+ (t
+ (setq twittering-edit-mode-info
+ (mapcar (lambda (entry)
+ (if (eq (car entry) 'tweet-type)
+ `(tweet-type
+ . ,(cdr (assq (cdr entry)
+ '((normal . reply)
+ (reply . normal)))))
+ entry))
+ twittering-edit-mode-info))
+ (twittering-edit-setup-help)))))
+
;;;;
;;;; Edit a status on minibuffer
;;;;

0 comments on commit 0306e1d

Please sign in to comment.