Skip to content

Commit

Permalink
Fix the regexp for "filter" timeline spec.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-extract-timeline-spec): fix the
regexp for "filter" timeline spec.
* test/test-twittering-mode.el (timeline-spec): add a test for
trailing backslashes.
  • Loading branch information
cvmat committed Feb 7, 2010
1 parent 9b2eea0 commit 7c19fae
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,11 @@
* test/test-twittering-mode.el (test-format-status): replace the
format specifier "%t" with "%T".

* twittering-mode.el (twittering-extract-timeline-spec): fix the
regexp for "filter" timeline spec.
* test/test-twittering-mode.el (timeline-spec): add a test for
trailing backslashes.

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

* twittering-mode.el (twittering-http-get): Add an optional
Expand Down
14 changes: 14 additions & 0 deletions test/test-twittering-mode.el
Expand Up @@ -200,6 +200,20 @@
'(filter "ABC/user" (user "mylist")))
'(t t))

(test-assert-equal
(test-restore-timeline-spec
":filter/ABC\\\\/user/mylist"
'(filter "ABC\\\\" (list "user" "mylist"))
'(filter "ABC\\\\" (list "user" "mylist")))
'(t t))

(test-assert-equal
(test-restore-timeline-spec
":filter/\\\\/user/mylist"
'(filter "\\\\" (list "user" "mylist"))
'(filter "\\\\" (list "user" "mylist")))
'(t t))

(test-assert-equal
(test-restore-timeline-spec
":retweeted_by_me" '(retweeted_by_me) '(retweeted_by_me))
Expand Down
3 changes: 2 additions & 1 deletion twittering-mode.el
Expand Up @@ -688,7 +688,8 @@ Return cons of the spec and the rest string."
(let ((first-spec (list (cdr (assoc type alist)))))
(cons first-spec following)))
((string= type "filter")
(if (string-match "^:filter/\\(.*?[^\\]\\)??/" str)
(if (string-match "^:filter/\\(\\(.*?[^\\]\\)??\\(\\\\\\\\\\)*\\)??/"
str)
(let* ((escaped-regexp (or (match-string 1 str) ""))
(regexp
(replace-regexp-in-string "\\\\/" "/"
Expand Down

0 comments on commit 7c19fae

Please sign in to comment.