From 0931ec3d1edaeb2ca92b2d845ed3ecd715a18e73 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 6 Mar 2017 00:00:59 -0500 Subject: notmuch: Add custom avy-goto-subword-1 command --- init.el | 2 ++ lisp/km-avy.el | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/init.el b/init.el index dcf6536..e768ba0 100644 --- a/init.el +++ b/init.el @@ -577,6 +577,8 @@ (after 'magit-log (define-key magit-log-mode-map "j" #'km/magit-avy-goto-subword-1) (define-key magit-cherry-mode-map "j" #'km/magit-avy-goto-subword-1)) + (after 'notmuch + (define-key notmuch-common-keymap "j" #'km/notmuch-avy-goto-subword-1)) (define-key occur-mode-map "j" #'km/occur-avy-goto-subword-1)) diff --git a/lisp/km-avy.el b/lisp/km-avy.el index cc733e3..e0be1d7 100644 --- a/lisp/km-avy.el +++ b/lisp/km-avy.el @@ -74,5 +74,17 @@ (km/avy-after-goto (call-interactively #'elfeed-search-show-entry))) +(declare-function notmuch-search-show-thread "notmuch" (&optional elide-toggle)) +(declare-function notmuch-tree-show-message "notmuch-tree" (ARG)) +;;;###autoload +(defun km/notmuch-avy-goto-subword-1 () + (interactive) + (km/avy-after-goto + (cl-case major-mode + (notmuch-search-mode + (notmuch-search-show-thread)) + (notmuch-tree-mode + (call-interactively #'notmuch-tree-show-message))))) + (provide 'km-avy) ;;; km-avy.el ends here -- cgit v1.2.3