aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJohnson Denen <johnson.denen@gmail.com>2017-04-18 09:17:25 -0400
committerJohnson Denen <johnson.denen@gmail.com>2017-04-18 10:44:40 -0400
commit35a896aaf700e68f92883e93ce4cc4c3d1196ae6 (patch)
tree28eb205f7a5178019bcde8588d7edbd99f66ce26 /lisp
parentb10430e7d42d3c07f4e71ed7375d256cd5fccbf8 (diff)
Rename mastodon-toot--property and move to tl feature
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el10
-rw-r--r--lisp/mastodon-toot.el9
2 files changed, 9 insertions, 10 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 9d2009d..a76aa1a 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -145,11 +145,17 @@
(number-to-string id)))))
(mastodon-http--get-json url)))
+(defun mastodon-tl--property (prop)
+ "Get property PROP for toot at point."
+ (or (get-text-property (point) prop)
+ (progn
+ (mastodon-tl--goto-next-toot)
+ (get-text-property (point) prop))))
+
(defun mastodon-tl--newest-id ()
"Return toot-id from the top of the buffer."
(goto-char (point-min))
- (mastodon-tl--goto-next-toot)
- (get-text-property (point) 'toot-id))
+ (mastodon-tl--property 'toot-id))
(defun mastodon-tl--update ()
"Update timeline with new toots."
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index ff20434..d677f5d 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -61,18 +61,11 @@ STATUS is passed by `url-retrieve'."
(interactive)
(kill-buffer-and-window))
-(defun mastodon-toot--property (prop)
- "Get property PROP for toot at point."
- (or (get-text-property (point) prop)
- (progn
- (mastodon-tl--goto-next-toot)
- (get-text-property (point) prop))))
-
;; TODO extract success callback
(defun mastodon-toot--boost ()
"Boost toot at point."
(interactive)
- (let* ((id (mastodon-toot--property 'toot-id))
+ (let* ((id (mastodon-tl--property 'toot-id))
(url (mastodon--api-for (concat "statuses/"
(number-to-string id)
"/reblog"))))