From a2cf6af06ab076dfcc9b032220259574ed3fcd9a Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 13 Sep 2021 21:58:11 +0200 Subject: make display of (scaled) avatars a customize option --- lisp/mastodon-tl.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index a6f3f9a..c5240db 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -82,11 +82,16 @@ width fonts when rendering HTML text")) "A unique identifier and functions for each Mastodon buffer.") (make-variable-buffer-local 'mastodon-tl--buffer-spec) -(defvar mastodon-tl--show-avatars-p - (if (version< emacs-version "27.1") - (image-type-available-p 'imagemagick) - (image-transforms-p)) - "A boolean value stating whether to show avatars in timelines.") +(defcustom mastodon-tl--show-avatars-p t + "Whether to enable display of user avatars in timelines." + :group 'mastodon-tl + :type '(boolean :tag "Whether to display user avatars in timelines")) + +;; (defvar mastodon-tl--show-avatars-p nil + ;; (if (version< emacs-version "27.1") + ;; (image-type-available-p 'imagemagick) + ;; (image-transforms-p)) + ;; "A boolean value stating whether to show avatars in timelines.") (defvar mastodon-tl--update-point nil "When updating a mastodon buffer this is where new toots will be inserted. @@ -267,7 +272,11 @@ Optionally start from POS." ;; TODO: Once we have a view for a user (e.g. their posts ;; timeline) make this a tab-stop and attach an action (concat - (when (and mastodon-tl--show-avatars-p mastodon-tl--display-media-p) + (when (and mastodon-tl--show-avatars-p + mastodon-tl--display-media-p + (if (version< emacs-version "27.1") + (image-type-available-p 'imagemagick) + (image-transforms-p))) (mastodon-media--get-avatar-rendering avatar-url)) (propertize name 'face 'mastodon-display-name-face) " (" -- cgit v1.2.3