From 918d34782ae3dba7a891825104affa0160b61b2c Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 7 Feb 2022 20:42:22 +0100 Subject: fix go to first toot on thread load --- lisp/mastodon-tl.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 84df69f..67047a3 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -962,7 +962,6 @@ webapp" (reblog (alist-get 'reblog json))) (if reblog (alist-get 'id reblog) id))) - (defun mastodon-tl--thread () "Open thread buffer for toot under `point'." (interactive) @@ -977,20 +976,21 @@ webapp" (if (> (+ (length (alist-get 'ancestors context)) (length (alist-get 'descendants context))) 0) - (with-output-to-temp-buffer buffer - (switch-to-buffer buffer) - (mastodon-mode) - (setq mastodon-tl--buffer-spec - `(buffer-name ,buffer - endpoint ,(format "statuses/%s/context" id) - update-function - (lambda(toot) (message "END of thread.")))) - (let ((inhibit-read-only t)) - (mastodon-tl--timeline (vconcat - (alist-get 'ancestors context) - `(,toot) - (alist-get 'descendants context))) - (mastodon-tl--goto-next-toot))) + (progn + (with-output-to-temp-buffer buffer + (switch-to-buffer buffer) + (mastodon-mode) + (setq mastodon-tl--buffer-spec + `(buffer-name ,buffer + endpoint ,(format "statuses/%s/context" id) + update-function + (lambda (toot) (message "END of thread.")))) + (let ((inhibit-read-only t)) + (mastodon-tl--timeline (vconcat + (alist-get 'ancestors context) + `(,toot) + (alist-get 'descendants context))))) + (mastodon-tl--goto-next-toot)) (message "No Thread!")))) (defun mastodon-tl--create-filter (word contexts) -- cgit v1.2.3