From d1aa39c22b43324751f8400aa303c7d467864665 Mon Sep 17 00:00:00 2001 From: Johnson Denen Date: Sat, 15 Apr 2017 21:07:20 -0400 Subject: Provide context menu from `with-eval-after-load' block Check for `discover' with `require' Clean up README --- lisp/mastodon.el | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lisp') 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 -- cgit v1.2.3