aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-08 17:27:33 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-08 17:28:36 +0200
commit92c1c26056ae16bb4774943f0045b8c10aaa0d92 (patch)
tree719aab766890c8cb84b60aa549de454905510c01
parent2ac021fbc1f7bf55be5d2cbc93f982fd3c1623dd (diff)
re-write stats-for-toot
-rw-r--r--lisp/mastodon-tl.el51
1 files changed, 25 insertions, 26 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 2c457b0..7e10c8d 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1668,34 +1668,33 @@ To disable showing the stats, customize
(faves (format "%s %s" faves-prop (mastodon-tl--symbol 'favourite)))
(boosts (format "%s %s" boosts-prop (mastodon-tl--symbol 'boost)))
(replies (format "%s %s" .replies_count (mastodon-tl--symbol 'reply)))
- (status (concat
- (propertize faves
- 'favourited-p (eq 't .favourited)
- 'favourites-field t
- 'help-echo (format "%s favourites" .favourites_count)
- 'face 'font-lock-comment-face)
- (propertize " | " 'face 'font-lock-comment-face)
- (propertize boosts
- 'boosted-p (eq 't .reblogged)
- 'boosts-field t
- 'help-echo (format "%s boosts" .reblogs_count)
- 'face 'font-lock-comment-face)
- (propertize " | " 'face 'font-lock-comment-face)
- (propertize replies
- 'replies-field t
- 'replies-count .replies_count
- 'help-echo (format "%s replies" .replies_count)
- 'face 'font-lock-comment-face)))
- (status
- (concat
- (propertize " "
- 'display
- `(space :align-to (- right ,(+ (length status) 7))))
- status)))
- status)))
+ (stats (concat
+ (propertize faves
+ 'favourited-p (eq 't .favourited)
+ 'favourites-field t
+ 'help-echo (format "%s favourites" .favourites_count)
+ 'face 'font-lock-comment-face)
+ (propertize " | " 'face 'font-lock-comment-face)
+ (propertize boosts
+ 'boosted-p (eq 't .reblogged)
+ 'boosts-field t
+ 'help-echo (format "%s boosts" .reblogs_count)
+ 'face 'font-lock-comment-face)
+ (propertize " | " 'face 'font-lock-comment-face)
+ (propertize replies
+ 'replies-field t
+ 'replies-count .replies_count
+ 'help-echo (format "%s replies" .replies_count)
+ 'face 'font-lock-comment-face)))
+ (right-spacing
+ (propertize " "
+ 'display
+ `(space :align-to (- right ,(+ (length stats) 7))))))
+ (concat right-spacing stats))))
(defun mastodon-tl--is-reply (toot)
- "Check if the TOOT is a reply to another one (and not boosted)."
+ "Check if the TOOT is a reply to another one (and not boosted).
+Used as a predicate in `mastodon-tl--timeline'."
(and (mastodon-tl--field 'in_reply_to_id toot)
(eq :json-false (mastodon-tl--field 'reblogged toot))))