Skip to content

Commit

Permalink
Add functions to switch timelines.
Browse files Browse the repository at this point in the history
* twittering-mode.el: Add functions to switch timelines.
(twittering-switch-to-next-timeline): new function.
(twittering-switch-to-previous-timeline): new function.
(twittering-mode-map): bind "f" and "b" to
`twittering-switch-to-next-timeline' and
`twittering-switch-to-previous-timeline', respectively.
  • Loading branch information
cvmat committed Apr 17, 2010
1 parent 7344be5 commit aee1827
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
`twittering-timeline-spec-string' and `twittering-active-mode'.
And register the current buffer to `twittering-buffer-info-list'.

* twittering-mode.el: Add functions to switch timelines.
(twittering-switch-to-next-timeline): new function.
(twittering-switch-to-previous-timeline): new function.
(twittering-mode-map): bind "f" and "b" to
`twittering-switch-to-next-timeline' and
`twittering-switch-to-previous-timeline', respectively.

2010-04-09 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-mode-init-global): initialize
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ existing way.
* Improved compatibility with global-font-lock mode.
* Unread statuses notifier on mode-line (experimental).
* Fixed fill-column for the format specifier "%FILL{...}".
* Switching timeline buffers by pressing 'f' or 'b'.
* ...

### Bug fixes
Expand Down
24 changes: 24 additions & 0 deletions twittering-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,28 @@ SPEC may be a timeline spec or a timeline spec string."
(twittering-get-and-render-timeline)))
buffer)))))

(defun twittering-switch-to-next-timeline ()
(interactive)
(when (twittering-buffer-p)
(let* ((buffer-list (twittering-get-buffer-list))
(following-buffers (cdr (memq (current-buffer) buffer-list)))
(next (if following-buffers
(car following-buffers)
(car buffer-list))))
(unless (eq (current-buffer) next)
(switch-to-buffer next)))))

(defun twittering-switch-to-previous-timeline ()
(interactive)
(when (twittering-buffer-p)
(let* ((buffer-list (reverse (twittering-get-buffer-list)))
(preceding-buffers (cdr (memq (current-buffer) buffer-list)))
(previous (if preceding-buffers
(car preceding-buffers)
(car buffer-list))))
(unless (eq (current-buffer) previous)
(switch-to-buffer previous)))))

;;;
;;; Unread statuses info
;;;
Expand Down Expand Up @@ -1627,6 +1649,8 @@ means the number of statuses retrieved after the last visiting of the buffer.")
(define-key km (kbd "v") 'twittering-other-user-timeline)
(define-key km (kbd "V") 'twittering-visit-timeline)
(define-key km (kbd "L") 'twittering-other-user-list-interactive)
(define-key km (kbd "f") 'twittering-switch-to-next-timeline)
(define-key km (kbd "b") 'twittering-switch-to-previous-timeline)
;; (define-key km (kbd "j") 'next-line)
;; (define-key km (kbd "k") 'previous-line)
(define-key km (kbd "j") 'twittering-goto-next-status)
Expand Down

0 comments on commit aee1827

Please sign in to comment.