Skip to content

Instantly share code, notes, and snippets.

@imarko
Last active December 6, 2022 01:11
Show Gist options
  • Save imarko/eec3398b407b04552f2521e880e06127 to your computer and use it in GitHub Desktop.
Save imarko/eec3398b407b04552f2521e880e06127 to your computer and use it in GitHub Desktop.
some mastodon.el utility functions
(defun my-mastodon-kill-buffers ()
"Kill all mastodon buffers."
(interactive)
(dolist (buffer (buffer-list))
(let ((mode (buffer-local-value 'major-mode buffer)))
(when (string-equal mode "mastodon-mode")
(kill-buffer buffer)))))
(defun my-mastodon-tl-scroll-up ()
"Scroll mastodon timeline up, refreshing if needed."
(interactive)
(condition-case nil
(scroll-up)
(end-of-buffer
(mastodon-tl--more))))
(defun my-mastodon-tl-scroll-down ()
"Scroll mastodon timeline down, refreshing if needed."
(interactive)
(condition-case nil
(scroll-down)
(beginning-of-buffer
(mastodon-tl--update))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment