aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el36
1 files changed, 29 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a87cd73..1a5fc33 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -122,6 +122,22 @@ nil."
:group 'mastodon-tl
:type '(boolean :tag "Whether to display user avatars in timelines"))
+(defcustom mastodon-tl--symbols
+ '((reply . ("💬" . "R"))
+ (boost . ("🔁" . "B"))
+ (favourite . ("⭐" . "F"))
+ (bookmark . ("🔖" . "K"))
+ (media . ("" . "M"))
+ (verified . ("" . "V"))
+ (private . ("🔒" . "P"))
+ (direct . ("✉" . "D"))
+ (edited . ("✍" . "E")))
+ "A set of symbols (and fallback strings) to be used in timeline.
+If a symbol does not look right (tofu), it means your
+font settings do not support it."
+ :type '(alist :key-type symbol :value-type string)
+ :group 'mastodon-tl)
+
(defvar-local mastodon-tl--update-point nil
"When updating a mastodon buffer this is where new toots will be inserted.
@@ -242,6 +258,16 @@ types of mastodon links and not just shr.el-generated ones.")
"The keymap to be set for the author byline.
It is active where point is placed by `mastodon-tl--goto-next-toot.'")
+(defun mastodon-tl--symbol (name)
+ "Return the unicode symbol (as a string) corresponding to NAME.
+If symbol is not displayable, an ASCII equivalent is returned. If
+NAME is not part of the symbol table, '?' is returned."
+ (if-let* ((symbol (alist-get name mastodon-tl--symbols)))
+ (if (char-displayable-p (string-to-char (car symbol)))
+ (car symbol)
+ (cdr symbol))
+ "?"))
+
;; NAV
(defun mastodon-tl--next-tab-item ()
@@ -603,6 +629,7 @@ this just means displaying toot client."
(faved (equal 't (mastodon-tl--field 'favourited toot)))
(boosted (equal 't (mastodon-tl--field 'reblogged toot)))
(bookmarked (equal 't (mastodon-tl--field 'bookmarked toot)))
+ (bookmark-str (mastodon-tl--symbol 'bookmark))
(visibility (mastodon-tl--field 'visibility toot))
(account (alist-get 'account toot))
(avatar-url (alist-get 'avatar account))
@@ -640,14 +667,9 @@ this just means displaying toot client."
(funcall author-byline toot)
;; visibility:
(cond ((equal visibility "direct")
- (if (fontp (char-displayable-p #10r9993))
- " ✉"
- " [direct]"))
+ (mastodon-tl--symbol 'direct))
((equal visibility "private")
- (if (fontp (char-displayable-p #10r128274))
- " 🔒"
- " [followers]")))
- ;; action:
+ (mastodon-tl--symbol 'private)))
(funcall action-byline toot)
" "
;; TODO: Once we have a view for toot (responses etc.) make