Skip to content

Commit

Permalink
Fix a bug occurring when editing a tweet from non-managed buffers.
Browse files Browse the repository at this point in the history
Thanks to mofigan who reported this problem.

* twittering-mode.el: Fix a bug that moves the cursor by calling
`twittering-update-status-interactive' from buffers which are not
managed by `twittering-mode'. Thanks to mofigan who reported this
problem.
(twittering-ensure-whole-of-status-is-visible): do not change
window configuration unless the given window is bound to a buffer
managed by `twittering-mode'.
  • Loading branch information
cvmat committed Jul 25, 2011
1 parent 421dfbb commit 97203b4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Expand Up @@ -9,6 +9,14 @@
prevents Twitter from confusing a username consisting of digits
with a user id.

* twittering-mode.el: Fix a bug that moves the cursor by calling
`twittering-update-status-interactive' from buffers which are not
managed by `twittering-mode'. Thanks to mofigan who reported this
problem.
(twittering-ensure-whole-of-status-is-visible): do not change
window configuration unless the given window is bound to a buffer
managed by `twittering-mode'.

2011-07-20 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Embed another root CA certificate to follow
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Expand Up @@ -27,6 +27,12 @@
been fixed yet because the API for `favorites' has no parameters to
directly specify a screen name not a user ID.
Thanks to Makoto Fujiwara who reported this problem.
* Fix of unintentional cursor motion on editing a tweet.
If the current buffer was not managed by `twittering-mode', the
cursor of the buffer was moved without intention by calling
`twittering-update-status-interactive' from the buffer. The bug has
been fixed.
Thanks to mofigan who reported this problem.

2.0.0: 2011-04-22
------------------
Expand Down
5 changes: 5 additions & 0 deletions NEWS.ja
Expand Up @@ -26,6 +26,11 @@
できていません。「お気に入り」を取得するAPIにユーザIDではなくユーザ
名を指定するパラメータがないためです。
Thanks to Makoto Fujiwara who reported this problem.
* tweet編集バッファを開いた際の意図しないカーソル移動を解消
`twittering-mode'で管理されていないバッファから
`twittering-update-status-function'を呼び出して編集バッファを作ると
元のバッファでのカーソルが不必要に動かされてしまうバグを解消しました。
Thanks to mofigan who reported this problem.

2.0.0: 2011-04-22
------------------
Expand Down
16 changes: 9 additions & 7 deletions twittering-mode.el
Expand Up @@ -7024,13 +7024,15 @@ entry in `twittering-edit-skeleton-alist' are performed.")
(defun twittering-ensure-whole-of-status-is-visible (&optional window)
"Ensure that the whole of the tweet on the current point is visible."
(interactive)
(let ((window (or window (selected-window))))
(with-current-buffer (window-buffer window)
(save-excursion
(let* ((next-head (or (twittering-get-next-status-head) (point-max)))
(current-tail (max (1- next-head) (point-min))))
(when (< (window-end window t) current-tail)
(twittering-set-window-end window current-tail)))))))
(let* ((window (or window (selected-window)))
(buffer (window-buffer window)))
(when (twittering-buffer-p buffer)
(with-current-buffer buffer
(save-excursion
(let* ((next-head (or (twittering-get-next-status-head) (point-max)))
(current-tail (max (1- next-head) (point-min))))
(when (< (window-end window t) current-tail)
(twittering-set-window-end window current-tail))))))))

(defun twittering-update-status-from-pop-up-buffer (&optional init-str reply-to-id username spec)
(interactive)
Expand Down

0 comments on commit 97203b4

Please sign in to comment.