diff options
-rw-r--r-- | README.org | 11 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 36 |
2 files changed, 31 insertions, 16 deletions
@@ -352,20 +352,13 @@ PRs, issues, feature requests, and general feedback are very welcome! and copy the backtrace that appears. 5. Open an issue here and explain what is going on. -*** Features +*** Fixes and features -1. Create an [[https://github.com/jdenen/mastodon.el/issues][issue]] detailing the feature you'd like to add. +1. Create an [[https://codeberg.org/martianh/mastodon.el/issues][issue]] detailing what you'd like to do. 2. Fork the repository and create a branch off of =develop=. 3. Run the tests and ensure that your code doesn't break any of them. 4. Create a pull request referencing the issue created in step 1. -*** Fixes - -1. In an [[https://github.com/jdenen/mastodon.el/issues][issue]], let me know that you're working to fix it. -2. Fork the repository and create a branch off of =develop=. -3. Run the tests and ensure that your code doesn't break any of them. -4. Create a pull request referencing the issue from step 1. - ** Supporting mastodon.el If you'd like to support continued development of =mastodon.el=, I accept 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 |