Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Suppress an error on a sentinel.

* twittering-mode.el: Suppress an error on a sentinel. Previously,
an error might be raised from a sentinel when a timeline of
non-existent user was requested. A sentinel for such a request
tries to remove the timeline spec string corresponding to
non-existent user from the history. In the process, conversion
from an invalid timeline spec string had caused an error.
(twittering-string-to-timeline-spec): add an optional argument
NOERROR. If NOERROR is non-nil, the function does not raise an
error even if SPEC-STR is invalid as a timeline spec string.
(twittering-equal-string-as-timeline): do not raise an error even
if either SPEC-STR1 or SPEC-STR2 is invalid as a timeline spec
string.
  • Loading branch information...
commit fb1ce5b01503e67879c3923c5348a34e9f93b00c 1 parent 48ae644
@cvmat cvmat authored
Showing with 37 additions and 6 deletions.
  1. +15 −0 ChangeLog
  2. +3 −0  NEWS
  3. +3 −0  NEWS.ja
  4. +16 −6 twittering-mode.el
View
15 ChangeLog
@@ -1,3 +1,18 @@
+2013-04-22 Tadashi MATSUO <tad@mymail.twin.jp>
+
+ * twittering-mode.el: Suppress an error on a sentinel. Previously,
+ an error might be raised from a sentinel when a timeline of
+ non-existent user was requested. A sentinel for such a request
+ tries to remove the timeline spec string corresponding to
+ non-existent user from the history. In the process, conversion
+ from an invalid timeline spec string had caused an error.
+ (twittering-string-to-timeline-spec): add an optional argument
+ NOERROR. If NOERROR is non-nil, the function does not raise an
+ error even if SPEC-STR is invalid as a timeline spec string.
+ (twittering-equal-string-as-timeline): do not raise an error even
+ if either SPEC-STR1 or SPEC-STR2 is invalid as a timeline spec
+ string.
+
2013-03-25 Tadashi MATSUO <tad@mymail.twin.jp>
* twittering-mode.el: Decode surrogate pairs in strings returned
View
3  NEWS
@@ -304,6 +304,9 @@
you can try to delete the status again because the status remains on
the buffer.
* Fix of the escape of a query string in a search timeline spec.
+* Fix of errors raised by asynchronous sentinels.
+ Previously, an error might be raised from a sentinel when a timeline of
+ non-existent user was requested. The bug has been fixed.
2.0.0: 2011-04-22
------------------
View
3  NEWS.ja
@@ -294,6 +294,9 @@
という応答を受け取った後に変更しました。APIが失敗に終わった場合、
対象tweetはbufferに残っているので再度削除を試みることができます。
* search timeline spec内の検索文字列のエスケープを修正
+* 非同期実行される関数がエラーを起こしていたのを修正
+ 存在しないユーザのtimelineを取得しようとすると非同期実行される関数が
+ エラーを起こしてしまっていましたので、修正しました。
2.0.0: 2011-04-22
------------------
View
22 twittering-mode.el
@@ -4364,10 +4364,18 @@ Return cons of the spec and the rest string."
nil)
))
-(defun twittering-string-to-timeline-spec (spec-str)
+(defun twittering-string-to-timeline-spec (spec-str &optional noerror)
"Convert SPEC-STR into a timeline spec.
-Return nil if SPEC-STR is invalid as a timeline spec."
- (let ((result-pair (twittering-extract-timeline-spec spec-str)))
+If SPEC-STR is invalid as a timeline spec string, raise an error or return
+nil if NOERROR is non-nil."
+ (let ((result-pair
+ (condition-case err
+ (twittering-extract-timeline-spec spec-str)
+ (error
+ (if noerror
+ nil
+ (signal (car err) (cdr err))
+ nil)))))
(if (and result-pair (string= "" (cdr result-pair)))
(car result-pair)
nil)))
@@ -4433,10 +4441,12 @@ If SPEC is not a search timeline spec, return nil."
(cadr spec)))
(defun twittering-equal-string-as-timeline (spec-str1 spec-str2)
- "Return non-nil if SPEC-STR1 equals SPEC-STR2 as a timeline spec."
+ "Return non-nil if SPEC-STR1 equals SPEC-STR2 as a timeline spec.
+If either SPEC-STR1 or SPEC-STR2 is invalid as a timeline spec string,
+return nil."
(if (and (stringp spec-str1) (stringp spec-str2))
- (let ((spec1 (twittering-string-to-timeline-spec spec-str1))
- (spec2 (twittering-string-to-timeline-spec spec-str2)))
+ (let ((spec1 (twittering-string-to-timeline-spec spec-str1 t))
+ (spec2 (twittering-string-to-timeline-spec spec-str2 t)))
(equal spec1 spec2))
nil))
Please sign in to comment.
Something went wrong with that request. Please try again.