diff options
author | Johnson Denen <johnson.denen@gmail.com> | 2017-04-15 21:07:20 -0400 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-04-15 21:15:08 -0400 |
commit | d1aa39c22b43324751f8400aa303c7d467864665 (patch) | |
tree | 3b55278ac988d659a2c15a38bfb9604b063a5d6f /lisp | |
parent | cb985db2f37eabd76b9c2643387b4e94009b3f88 (diff) |
Provide context menu from `with-eval-after-load' block
Check for `discover' with `require'
Clean up README
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon.el | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 8511d9e..edc1d03 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -102,10 +102,8 @@ (define-key map (kbd "Q") #'kill-buffer-and-window) (define-key map (kbd "T") #'mastodon-tl--get-tag-timeline))) -(defun provide-discover-context-menu () - "Provides a shortcut overview through Discover mode. -Press '?' to activate it." - (when (bound-and-true-p discover-mode) +(with-eval-after-load 'mastodon + (when (require 'discover nil :noerror) (discover-add-context-menu :bind "?" :mode 'mastodon-mode @@ -124,7 +122,5 @@ Press '?' to activate it." ("q" "Quit mastodon buffer. Leave window open." kill-this-buffer) ("Q" "Quit mastodon buffer and kill window." kill-buffer-and-window))))))) -(add-hook 'mastodon-mode-hook 'provide-discover-context-menu t) - (provide 'mastodon) ;;; mastodon.el ends here |