summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-03-25 20:31:53 -0400
committerKyle Meyer <kyle@kyleam.com>2016-03-25 20:31:53 -0400
commit05e2388914942fa10c0d23ba5070c20c0af6a445 (patch)
treeb2461e3dc30d06c0bbf94ec8c58c45f18c04846d
parent7261b8b20d6a1246cb3d19cf65229df4a884f7e3 (diff)
downloademacs.d-05e2388914942fa10c0d23ba5070c20c0af6a445.tar.gz
Add gnus-pipe-to-project command
-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