Permalink
Browse files

`twittering-current-timeline-data' returns nil if spec is not specified.

* 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 978571f4a9738b3e8b2c733eae5a43baec23344e
Showing with 17 additions and 3 deletions.
  1. +9 −0 ChangeLog
  2. +8 −3 twittering-mode.el
View
@@ -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
View
@@ -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))
@@ -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))))

0 comments on commit 978571f

Please sign in to comment.