summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el2
-rw-r--r--lisp/km-mail.el12
2 files changed, 14 insertions, 0 deletions
diff --git a/init.el b/init.el
index 23357cc..22ade83 100644
--- a/init.el
+++ b/init.el
@@ -1932,11 +1932,13 @@
(after 'gnus-sum
(bind-keys :map gnus-summary-mode-map
+ ("|" . km/gnus-pipe-to-project)
("c" . km/gnus-summary-catchup)
("l" . km/gnus-copy-message-link)
("o" . km/ace-link-widget)))
(after 'gnus-art
(bind-keys :map gnus-article-mode-map
+ ("|" . km/gnus-pipe-to-project)
("C-c l" . km/gnus-follow-last-message-link)
("e" . km/shr-browse-url-and-goto-next)
("o" . km/ace-link-widget)))
diff --git a/lisp/km-mail.el b/lisp/km-mail.el
index 9a3a3ab..35355c5 100644
--- a/lisp/km-mail.el
+++ b/lisp/km-mail.el
@@ -21,6 +21,7 @@
;;; Code:
(require 'dash)
+(require 'projectile)
(require 'gnus)
(require 'gnus-group)
(require 'gnus-topic)
@@ -127,6 +128,17 @@ to group buffer instead of moving to next group."
(shr-browse-url)
(shr-next-link))
+(defun km/gnus-pipe-to-project ()
+ "Call `gnus-summary-pipe-output' in project root."
+ (interactive)
+ (let ((default-directory (completing-read
+ "Project: "
+ (projectile-relevant-known-projects)))
+ (gnus-summary-pipe-output-default-command
+ (or gnus-summary-pipe-output-default-command
+ "git am")))
+ (call-interactively #'gnus-summary-pipe-output)))
+
;;; Message mode