Skip to content

Commit

Permalink
(twittering-make-clickable-status-datum): when trying to add a text p…
Browse files Browse the repository at this point in the history
…roperty to 'source', check it is non-nil first for avoiding an error caused by 'string-match'.
  • Loading branch information
yata committed Feb 12, 2010
1 parent 6a7ce63 commit 0036e82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -133,6 +133,10 @@
* twittering-mode.el (twittering-extract-timeline-spec): Fix the
regexp for "search" timeline spec; same as for "filter".

* twittering-mode.el (twittering-make-clickable-status-datum):
When trying to add a text property to `source', check it is
non-nil first for avoiding an error caused by `string-match'.

2010-02-07 Tadashi MATSUO <tad@mymail.twin.jp>

* test/test-twittering-mode.el (test-format-status): replace the
Expand Down
5 changes: 3 additions & 2 deletions twittering-mode.el
Expand Up @@ -2038,7 +2038,8 @@ If ID of STATUS-DATUM is already in ID-TABLE, return nil. If not, return t."
(setq regexp-index (match-end 0)))))

;; make source pretty and clickable
(if (string-match "<a href=\"\\(.*?\\)\".*?>\\(.*\\)</a>" source)
(if (and source
(string-match "<a href=\"\\(.*?\\)\".*?>\\(.*\\)</a>" source))
(let ((uri (match-string-no-properties 1 source))
(caption (match-string-no-properties 2 source)))
(setq source caption)
Expand All @@ -2049,7 +2050,7 @@ If ID of STATUS-DATUM is already in ID-TABLE, return nil. If not, return t."
face twittering-uri-face
source ,source)
source)
(add-to-list 'status (cons 'source source))
(add-to-list 'status (cons 'source source))
))

;; make hashtag in text clickable
Expand Down

0 comments on commit 0036e82

Please sign in to comment.