Skip to content

Commit

Permalink
(twittering-icon-mode): call 'twittering-update-mode-line' and 'twitt…
Browse files Browse the repository at this point in the history
…ering-render-timeline' only when mode was changed.

(twittering-scroll-mode): likewise.
(twittering-jojo-mode): likewise.
(twittering-toggle-reverse-mode): likewise.
  • Loading branch information
yata committed Feb 22, 2010
1 parent cb9333c commit 39950ad
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 21 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
(twittering-timeline-spec-to-host-method): Likewise.
(twittering-timeline-spec-alias): Likewise in a comment.

* twittering-mode.el (twittering-icon-mode): Call
`twittering-update-mode-line' and `twittering-render-timeline'
only when mode was changed.
(twittering-scroll-mode): Likewise.
(twittering-jojo-mode): Likewise.
(twittering-toggle-reverse-mode): Likewise.

2010-02-16 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-get-first-status-head): return
Expand Down
50 changes: 29 additions & 21 deletions twittering-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ You should change through function `twittering-icon-mode'.")
With a numeric argument, if the argument is positive, turn on
icon mode; otherwise, turn off icon mode."
(interactive "P")
(setq twittering-icon-mode
(if (null arg)
(not twittering-icon-mode)
(< 0 (prefix-numeric-value arg))))
(twittering-update-mode-line)
(twittering-render-timeline))
(let ((prev-mode twittering-icon-mode))
(setq twittering-icon-mode
(if (null arg)
(not twittering-icon-mode)
(< 0 (prefix-numeric-value arg))))
(when (not (eq prev-mode twittering-icon-mode))
(twittering-update-mode-line)
(twittering-render-timeline))))

(defvar twittering-image-data-table (make-hash-table :test 'equal))

Expand Down Expand Up @@ -2835,27 +2837,33 @@ variable `twittering-status-format'."

(defun twittering-scroll-mode (&optional arg)
(interactive "P")
(setq twittering-scroll-mode
(if (null arg)
(not twittering-scroll-mode)
(< 0 (prefix-numeric-value arg))))
(twittering-update-mode-line))
(let ((prev-mode twittering-scroll-mode))
(setq twittering-scroll-mode
(if (null arg)
(not twittering-scroll-mode)
(< 0 (prefix-numeric-value arg))))
(when (not (eq prev-mode twittering-scroll-mode))
(twittering-update-mode-line))))

(defun twittering-jojo-mode (&optional arg)
(interactive "P")
(setq twittering-jojo-mode
(if (null arg)
(not twittering-jojo-mode)
(< 0 (prefix-numeric-value arg))))
(twittering-update-mode-line))
(let ((prev-mode twittering-jojo-mode))
(setq twittering-jojo-mode
(if (null arg)
(not twittering-jojo-mode)
(< 0 (prefix-numeric-value arg))))
(when (not (eq prev-mode twittering-jojo-mode))
(twittering-update-mode-line))))

(defun twittering-toggle-reverse-mode (&optional arg)
(interactive "P")
(setq twittering-reverse-mode
(if (null arg)
(not twittering-reverse-mode)
(> (prefix-numeric-value arg) 0)))
(twittering-render-timeline))
(let ((prev-mode twittering-reverse-mode))
(setq twittering-reverse-mode
(if (null arg)
(not twittering-reverse-mode)
(< 0 (prefix-numeric-value arg))))
(when (not (eq prev-mode twittering-reverse-mode))
(twittering-update-mode-line))))

(defun twittering-friends-timeline ()
(interactive)
Expand Down

0 comments on commit 39950ad

Please sign in to comment.