From 222164eef6bba39b001f914d58f1535d32267e49 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 28 Feb 2017 23:54:34 -0500 Subject: notmuch: Add pipe-to-project commands --- init.el | 11 +++++++++++ lisp/km-mail.el | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/init.el b/init.el index 1d9d5a1..8ad561d 100644 --- a/init.el +++ b/init.el @@ -2052,6 +2052,17 @@ (define-key notmuch-tree-mode-map "e" #'notmuch-tree-show-message) (define-key notmuch-search-mode-map "e" #'notmuch-search-show-thread)) +(use-package km-mail + :defer t + :after notmuch + :config + (define-key notmuch-show-part-map "|" + #'km/notmuch-show-pipe-part-to-project) + (define-key notmuch-show-mode-map [remap notmuch-show-pipe-message] + #'km/notmuch-show-pipe-message-to-project) + (define-key notmuch-tree-mode-map [remap notmuch-show-pipe-message] + #'km/notmuch-show-pipe-message-to-project)) + (use-package mml :defer t :diminish (mml-mode . "ML")) diff --git a/lisp/km-mail.el b/lisp/km-mail.el index ddc5de9..3ab7e50 100644 --- a/lisp/km-mail.el +++ b/lisp/km-mail.el @@ -32,6 +32,24 @@ (with-current-notmuch-show-message (km/open-github-patch (current-buffer)))) +;;;###autoload +(defun km/notmuch-show-pipe-message-to-project (project) + (interactive + (list (expand-file-name + (completing-read "Project: " + (projectile-relevant-known-projects))))) + (let ((default-directory project)) + (call-interactively #'notmuch-show-pipe-message))) + +;;;###autoload +(defun km/notmuch-show-pipe-part-to-project (project) + (interactive + (list (expand-file-name + (completing-read "Project: " + (projectile-relevant-known-projects))))) + (let ((default-directory project)) + (call-interactively #'notmuch-show-pipe-part))) + ;;; Mail sync -- cgit v1.2.3