Permalink
Browse files

(twittering-icon-mode): call 'twittering-update-mode-line' and 'twitt…

…ering-render-timeline' only when mode was changed.

(twittering-scroll-mode): likewise.
(twittering-jojo-mode): likewise.
(twittering-toggle-reverse-mode): likewise.
  • Loading branch information...
1 parent cb9333c commit 39950ad7c7fb03b0ab04b82a666b6359099cec69 @yata yata committed Feb 19, 2010
Showing with 36 additions and 21 deletions.
  1. +7 −0 ChangeLog
  2. +29 −21 twittering-mode.el
View
@@ -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
View
@@ -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))
@@ -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)

0 comments on commit 39950ad

Please sign in to comment.