Skip to content

Commit

Permalink
"U" pushes a URI of a tweet on text without a uri property.
Browse files Browse the repository at this point in the history
* twittering-mode.el: "U" pushes a URI of a tweet on text without
a uri property.
(twittering-push-uri-onto-kill-ring): push a URI of a tweet unless
the currently pointed character has a uri property.
  • Loading branch information
cvmat committed Apr 8, 2011
1 parent 3e941b1 commit 6a9fbff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
to a proxy. They are added in functions for each connection
method.

* twittering-mode.el: "U" pushes a URI of a tweet on text without
a uri property.
(twittering-push-uri-onto-kill-ring): push a URI of a tweet unless
the currently pointed character has a uri property.

2011-03-27 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Discard standard error of the program
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
(setq twittering-api-prefix "api/")
(setq twittering-search-api-method "api/search")
(setq twittering-web-path-prefix "")
* Copy a URI in a tweet or a URI pointing to the tweet by "U".
Thanks to Faried Nawaz.
* Copy tweets by "C-<mouse-3>".
Thanks to Faried Nawaz.
* Support for `wget'.
Expand Down
2 changes: 2 additions & 0 deletions NEWS.ja
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
(setq twittering-api-prefix "api/")
(setq twittering-search-api-method "api/search")
(setq twittering-web-path-prefix "")
* "U"でtweet中のURIやそのtweet自体へのURIをコピー
Thanks to Faried Nawaz.
* "C-<mouse-3>"でtweetをコピー
Thanks to Faried Nawaz.
* wgetによるtweet取得に対応
Expand Down
12 changes: 9 additions & 3 deletions twittering-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -7826,10 +7826,16 @@ which fetch older tweets on reverse-mode."

(defun twittering-push-uri-onto-kill-ring ()
"Push URI on the current position onto the kill ring.
If the character on the current position does not have `uri' property,
this function does nothing."
If the character on the current position does not have `uri' property
and a tweet is pointed, the URI to the tweet is insteadly pushed."
(interactive)
(let ((uri (get-text-property (point) 'uri)))
(let ((uri (or (get-text-property (point) 'uri)
(if (get-text-property (point) 'field)
(let ((id (or (get-text-property (point) 'retweeted-id)
(get-text-property (point) 'id)))
(username (get-text-property (point) 'username)))
(twittering-get-status-url username id))
nil))))
(cond
((not (stringp uri))
nil)
Expand Down

0 comments on commit 6a9fbff

Please sign in to comment.