Skip to content

Commit

Permalink
`twittering-goto-first-status' is added and bound to "H".
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-get-first-status-head): add.
(twittering-goto-first-status): add.
(twittering-mode-map): bind `twittering-goto-first-status' to "H"
instead of `begininng-of-buffer'.
(twittering-render-timeline): use `twittering-goto-first-status'.
  • Loading branch information
cvmat committed Jan 20, 2010
1 parent 2f34878 commit 10a83ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Expand Up @@ -18,6 +18,14 @@
* twittering-mode.el (twittering-update-jojo): Make a tweet by
`twittering-ucs-to-char' instead of `string-as-multibyte'.

2010-01-19 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-get-first-status-head): add.
(twittering-goto-first-status): add.
(twittering-mode-map): bind `twittering-goto-first-status' to "H"
instead of `begininng-of-buffer'.
(twittering-render-timeline): use `twittering-goto-first-status'.

2010-01-18 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-ucs-to-char): Add a workaround
Expand Down
22 changes: 14 additions & 8 deletions twittering-mode.el
Expand Up @@ -887,7 +887,7 @@ Return nil if STR is invalid as a timeline spec."
(define-key km [backtab] 'twittering-goto-previous-thing)
(define-key km [backspace] 'backward-char)
(define-key km "G" 'end-of-buffer)
(define-key km "H" 'beginning-of-buffer)
(define-key km "H" 'twittering-goto-first-status)
(define-key km "i" 'twittering-icon-mode)
(define-key km "s" 'twittering-scroll-mode)
(define-key km "t" 'twittering-toggle-proxy)
Expand Down Expand Up @@ -1845,13 +1845,7 @@ If STATUS-DATUM is already in DATA-VAR, return nil. If not, return t."
(unless additional
(erase-buffer))
;; Go to the head of the first status.
(if (get-text-property (point-min) 'id)
(goto-char (point-min))
(let ((next (twittering-get-next-status-head (point-min))))
(if next
(goto-char next)
;; The current buffer is empty.
(goto-char (point-min)))))
(twittering-goto-first-status)
(mapc
(lambda (status)
(let* ((id (cdr (assoc 'id status))))
Expand Down Expand Up @@ -2780,6 +2774,18 @@ variable `twittering-status-format'"
(or twittering-password-active
(setq twittering-password-active (read-passwd "your twitter password: "))))

(defun twittering-goto-first-status ()
"Go to the first status."
(interactive)
(goto-char (twittering-get-first-status-head)))

(defun twittering-get-first-status-head ()
(if (get-text-property (point-min) 'id)
(point-min)
(or (twittering-get-next-status-head (point-min))
;; The current buffer is empty.
(point-min))))

(defun twittering-goto-next-status ()
"Go to next status."
(interactive)
Expand Down

0 comments on commit 10a83ee

Please sign in to comment.