Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(twittering-extract-timeline-spec): on search-mode, return a spec onl…
…y when the length of 'escaped-query' is greater than zero.
  • Loading branch information
yata committed Feb 12, 2010
1 parent a72c16d commit 5d1ec55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -284,6 +284,10 @@
argument to `min' for avoiding error "Wrong number of arguments:
min, 0".

* twittering-mode.el (twittering-extract-timeline-spec): On
search-mode, return a spec only when the length of `escaped-query'
is greater than zero.

2010-01-28 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-render-timeline): simplified by
Expand Down
12 changes: 7 additions & 5 deletions twittering-mode.el
Expand Up @@ -728,18 +728,20 @@ Return cons of the spec and the rest string."
(cons first-spec following)))
((string= type "search")
(if (string-match "^:search/\\(.*?[^\\]\\)??/" str)
(let* ((escaped-query (match-string 1 str))
(let* ((escaped-query (or (match-string 1 str) ""))
(query (replace-regexp-in-string "\\\\/" "/"
escaped-query nil t))
(rest (substring str (match-end 0))))
`((search ,query) . ,rest))))
(if (< 0 (length escaped-query))
`((search ,query) . ,rest)
(error "\"%s\" has no valid regexp" str)
nil))))
((string= type "filter")
(if (string-match "^:filter/\\(\\(.*?[^\\]\\)??\\(\\\\\\\\\\)*\\)??/"
str)
(let* ((escaped-regexp (or (match-string 1 str) ""))
(regexp
(replace-regexp-in-string "\\\\/" "/"
escaped-regexp nil t))
(regexp (replace-regexp-in-string "\\\\/" "/"
escaped-regexp nil t))
(following (substring str (match-end 0)))
(pair (twittering-extract-timeline-spec
following unresolved-aliases))
Expand Down

0 comments on commit 5d1ec55

Please sign in to comment.