Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

`twittering-get-first-status-head' returns nil if no statuses exist.

* twittering-mode.el (twittering-get-first-status-head): return
nil if no statuses are rendered in the current buffer.
(twittering-goto-first-status): go to the beginning of buffer if
no statuses are rendered in the current buffer.
(twittering-render-timeline): render tweets from the beginning of
buffer if no statuses are rendered.
  • Loading branch information...
commit 7d7151856c8e05dc3fd5c8409e3eedcb61beefba 1 parent 0a172c9
@cvmat cvmat authored
Showing with 19 additions and 6 deletions.
  1. +10 −1 ChangeLog
  2. +9 −5 twittering-mode.el
View
11 ChangeLog
@@ -1,8 +1,17 @@
+2010-02-16 Tadashi MATSUO <tad@mymail.twin.jp>
+
+ * twittering-mode.el (twittering-get-first-status-head): return
+ nil if no statuses are rendered in the current buffer.
+ (twittering-goto-first-status): go to the beginning of buffer if
+ no statuses are rendered in the current buffer.
+ (twittering-render-timeline): render tweets from the beginning of
+ buffer if no statuses are rendered.
+
2010-02-15 Satoshi Yatagawa <yata_github@y.hauN.org>
* twittering-mode.el (twittering-http-get-list-index-sentinel):
Get a listname from `slug' element which is only in `list' node.
-
+
2010-02-15 Tadashi MATSUO <tad@mymail.twin.jp>
* twittering-mode.el (twittering-get-and-render-timeline): copy
View
14 twittering-mode.el
@@ -2154,6 +2154,7 @@ BUFFER may be a buffer or the name of an existing buffer."
(with-current-buffer (twittering-buffer)
(let* ((timeline-data (or timeline-data
(twittering-current-timeline-data)))
+ (empty (null (twittering-get-first-status-head)))
(window-list (get-buffer-window-list (current-buffer) nil t))
(point-window-list
(mapcar (lambda (window)
@@ -2165,7 +2166,9 @@ BUFFER may be a buffer or the name of an existing buffer."
(save-excursion
(unless additional
(erase-buffer))
- (let ((pos (twittering-get-first-status-head)))
+ (let ((pos (if empty
+ (point-min)
+ (twittering-get-first-status-head))))
(mapc
(lambda (status)
(let* ((id (cdr (assoc 'id status))))
@@ -3153,14 +3156,15 @@ variable `twittering-status-format'."
(defun twittering-goto-first-status ()
"Go to the first status."
(interactive)
- (goto-char (twittering-get-first-status-head)))
+ (goto-char (or (twittering-get-first-status-head)
+ (point-min))))
(defun twittering-get-first-status-head ()
+ "Return the head position of the first status in the current buffer.
+Return nil if no statuses are rendered."
(if (get-text-property (point-min) 'id)
(point-min)
- (or (twittering-get-next-status-head (point-min))
- ;; The current buffer is empty.
- (point-min))))
+ (twittering-get-next-status-head (point-min))))
(defun twittering-goto-next-status ()
"Go to next status."
Please sign in to comment.
Something went wrong with that request. Please try again.