Skip to content

Commit

Permalink
`twittering-current-timeline-data' returns nil if spec is not specified.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-current-timeline-spec): return
nil if `twittering-current-timeline-spec-string' returns nil.
(twittering-current-timeline-data): return nil if
`twittering-current-timeline-spec' returns nil.
(twittering-extract-timeline-spec): raise an error if the argument
`str' is nil.
  • Loading branch information
cvmat committed Feb 17, 2010
1 parent 3f0c2b6 commit 978571f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
@@ -1,3 +1,12 @@
2010-02-18 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-current-timeline-spec): return
nil if `twittering-current-timeline-spec-string' returns nil.
(twittering-current-timeline-data): return nil if
`twittering-current-timeline-spec' returns nil.
(twittering-extract-timeline-spec): raise an error if the argument
`str' is nil.

2010-02-17 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-extract-timeline-spec): Check STR
Expand Down
11 changes: 8 additions & 3 deletions twittering-mode.el
Expand Up @@ -699,6 +699,7 @@ If SHORTEN is non-nil, the abbreviated expression will be used."
Return cons of the spec and the rest string."
(cond
((null str)
(error "STR is nil" str)
nil)
((string-match "^\\([a-zA-Z0-9_-]+\\)/\\([a-zA-Z0-9_-]+\\)" str)
(let ((user (match-string 1 str))
Expand Down Expand Up @@ -938,12 +939,16 @@ Return nil if SPEC-STR is invalid as a timeline spec."
twittering-current-timeline-spec-string)

(defun twittering-current-timeline-spec ()
(twittering-string-to-timeline-spec
(twittering-current-timeline-spec-string)))
(let ((spec-string (twittering-current-timeline-spec-string)))
(if spec-string
(twittering-string-to-timeline-spec spec-string)
nil)))

(defun twittering-current-timeline-data (&optional spec)
(let ((spec (or spec (twittering-current-timeline-spec))))
(gethash spec twittering-timeline-data-table)))
(if spec
(gethash spec twittering-timeline-data-table)
nil)))

(defun twittering-remove-timeline-data (&optional spec)
(let ((spec (or spec (twittering-current-timeline-spec))))
Expand Down

0 comments on commit 978571f

Please sign in to comment.