aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-discover.el
diff options
context:
space:
mode:
authorJohnson Denen <johnson.denen@gmail.com>2019-03-04 21:45:45 -0500
committerJohnson Denen <johnson.denen@gmail.com>2019-03-04 22:44:28 -0500
commitf169c9e26b7f5f95770c409c53dd04a4b92cb666 (patch)
tree5f85c8eeca58d06e80458d23fcd284e3f2a31163 /lisp/mastodon-discover.el
parent3196ac0c89fb67eb79ccc10132a5e2c7baa65c99 (diff)
Refactor mastodon-discover functionality
Diffstat (limited to 'lisp/mastodon-discover.el')
-rw-r--r--lisp/mastodon-discover.el62
1 files changed, 31 insertions, 31 deletions
diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el
index 5f248f8..a7fcb37 100644
--- a/lisp/mastodon-discover.el
+++ b/lisp/mastodon-discover.el
@@ -31,39 +31,39 @@
;; See the README file for how to use this.
;;; Code:
-(require 'discover)
-(defun mastodon-discover--init ()
- "Plug Mastodon functionality into discover."
+(defun mastodon-discover ()
+ "Plug Mastodon functionality into `discover'."
(interactive)
- (discover-add-context-menu
- :bind "?"
- :mode 'mastodon-mode
- :mode-hook 'mastodon-mode-hook
- :context-menu '(mastodon
- (description "Mastodon feed viewer")
- (actions
- ("Toots"
- ("A" "Author" mastodon-profile--get-toot-author)
- ("b" "Boost" mastodon-toot--boost)
- ("c" "Toggle content" mastodon-tl--toggle-spoiler-text-in-toot)
- ("f" "Favourite" mastodon-toot--favourite)
- ("j" "Next" mastodon-tl--goto-next-toot)
- ("k" "Prev" mastodon-tl--goto-prev-toot)
- ("n" "Send" mastodon-toot)
- ("r" "Reply" mastodon-toot--reply)
- ("t" "Thread" mastodon-tl--thread)
- ("u" "Update" mastodon-tl--update)
- ("U" "Users" mastodon-profile--show-user))
- ("Timelines"
- ("F" "Federated" mastodon-tl--get-federated-timeline)
- ("H" "Home" mastodon-tl--get-home-timeline)
- ("L" "Local" mastodon-tl--get-local-timeline)
- ("N" "Notifications" mastodon-notifications--get)
- ("T" "Tag" mastodon-tl--get-tag-timeline))
- ("Quit"
- ("q" "Quit mastodon buffer. Leave window open." kill-this-buffer)
- ("Q" "Quit mastodon buffer and kill window." kill-buffer-and-window))))))
+ (when (require 'discover nil :noerror)
+ (discover-add-context-menu
+ :bind "?"
+ :mode 'mastodon-mode
+ :mode-hook 'mastodon-mode-hook
+ :context-menu '(mastodon
+ (description "Mastodon feed viewer")
+ (actions
+ ("Toots"
+ ("A" "Author" mastodon-profile--get-toot-author)
+ ("b" "Boost" mastodon-toot--boost)
+ ("c" "Toggle content" mastodon-tl--toggle-spoiler-text-in-toot)
+ ("f" "Favourite" mastodon-toot--favourite)
+ ("j" "Next" mastodon-tl--goto-next-toot)
+ ("k" "Prev" mastodon-tl--goto-prev-toot)
+ ("n" "Send" mastodon-toot)
+ ("r" "Reply" mastodon-toot--reply)
+ ("t" "Thread" mastodon-tl--thread)
+ ("u" "Update" mastodon-tl--update)
+ ("U" "Users" mastodon-profile--show-user))
+ ("Timelines"
+ ("F" "Federated" mastodon-tl--get-federated-timeline)
+ ("H" "Home" mastodon-tl--get-home-timeline)
+ ("L" "Local" mastodon-tl--get-local-timeline)
+ ("N" "Notifications" mastodon-notifications--get)
+ ("T" "Tag" mastodon-tl--get-tag-timeline))
+ ("Quit"
+ ("q" "Quit mastodon buffer. Leave window open." kill-this-buffer)
+ ("Q" "Quit mastodon buffer and kill window." kill-buffer-and-window)))))))
(provide 'mastodon-discover)
;;; mastodon-discover.el ends here