Last active
February 15, 2024 03:19
-
-
Save rtrppl/2afd098470d9c74086d412a59ff852c1 to your computer and use it in GitHub Desktop.
mastodon in .emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq instance-selection-list '()) | |
(push "https://mastodon.social@laotang" instance-selection-list) | |
(push "https://emacs.ch@laotang" instance-selection-list) | |
(defun lt/switch-mastodon-user () | |
(interactive) | |
(let* ((instance-user (completing-read "" instance-selection-list))) | |
(when (string-match "\\(.*\\)\\(@.*\\)" instance-user) | |
(let* ((selected-instance (match-string 1 instance-user)) | |
(selected-user (match-string 2 instance-user))) | |
(setq mastodon-instance-url selected-instance mastodon-active-user selected-user)))) | |
(mastodon-client--make-current-user-active)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment