Skip to content

Commit

Permalink
(twittering-status-to-status-datum): change 'regex-index' variable to…
Browse files Browse the repository at this point in the history
… local scope from global one.
  • Loading branch information
yata committed Feb 8, 2010
1 parent 4117e5c commit 766fccd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -4,6 +4,11 @@
`twittering-release-process' when status code is not equal to
"200", forgotten in the 2010-02-06 changing.

* twittering-mode.el (twittering-status-to-status-datum): Change
`regex-index' variable to local scope from global one.
(twittering-status-to-status-datum): Rename `regex-index' to
`regexp-index'.

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

* test/test-twittering-mode.el (test-format-status): replace the
Expand Down
53 changes: 25 additions & 28 deletions twittering-mode.el
Expand Up @@ -1785,37 +1785,34 @@ If ID of STATUS-DATUM is already in ID-TABLE, return nil. If not, return t."
uri ,(concat "http://twitter.com/" screen-name)
face twittering-username-face)
text)

(setq pos next-pos)))))

;; make URI clickable
(setq regex-index 0)
(while regex-index
(setq regex-index
(string-match "@\\([a-zA-Z0-9_-]+\\)\\|\\(https?://[-_.!~*'()a-zA-Z0-9;/?:@&=+$,%#]+\\)"
text
regex-index))
(when regex-index
(let* ((matched-string (match-string-no-properties 0 text))
(screen-name (match-string-no-properties 1 text))
(uri (match-string-no-properties 2 text)))
(add-text-properties
(if screen-name
(+ 1 (match-beginning 0))
(match-beginning 0))
(match-end 0)
(if screen-name
`(mouse-face
highlight
face twittering-uri-face
uri ,(concat "http://twitter.com/" screen-name)
uri-in-text ,(concat "http://twitter.com/" screen-name))
`(mouse-face highlight
face twittering-uri-face
uri ,uri
uri-in-text ,uri))
text))
(setq regex-index (match-end 0)) ))
(let ((regexp-index 0))
(while regexp-index
(setq regexp-index
(string-match "@\\([a-zA-Z0-9_-]+\\)\\|\\(https?://[-_.!~*'()a-zA-Z0-9;/?:@&=+$,%#]+\\)" text regexp-index))
(when regexp-index
(let* ((matched-string (match-string-no-properties 0 text))
(screen-name (match-string-no-properties 1 text))
(uri (match-string-no-properties 2 text)))
(add-text-properties
(if screen-name
(+ 1 (match-beginning 0))
(match-beginning 0))
(match-end 0)
(if screen-name
`(mouse-face
highlight
face twittering-uri-face
uri ,(concat "http://twitter.com/" screen-name)
uri-in-text ,(concat "http://twitter.com/" screen-name))
`(mouse-face highlight
face twittering-uri-face
uri ,uri
uri-in-text ,uri))
text))
(setq regexp-index (match-end 0)))))

;; make source pretty and clickable
(if (string-match "<a href=\"\\(.*?\\)\".*?>\\(.*\\)</a>" source)
Expand Down

0 comments on commit 766fccd

Please sign in to comment.