summaryrefslogtreecommitdiff
path: root/mailscripts.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-11-02 10:06:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-11-02 10:06:39 -0700
commitcb53ee3309fb20492bdb2d43c4596ed507140701 (patch)
tree520bd4f8b68bb263e627906810abdd1d7f01044a /mailscripts.el
parent8d2dcb9d14a681c3ba86dc2f67756a5619f4d10d (diff)
downloadmailscripts-cb53ee3309fb20492bdb2d43c4596ed507140701.tar.gz
mailscripts.el: add notmuch-extract-thread-patches-projectile
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'mailscripts.el')
-rw-r--r--mailscripts.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/mailscripts.el b/mailscripts.el
index a2ec230..bcdc0ad 100644
--- a/mailscripts.el
+++ b/mailscripts.el
@@ -2,7 +2,7 @@
;; Author: Sean Whitton <spwhitton@spwhitton.name>
;; Version: 0.12
-;; Package-Requires: (notmuch)
+;; Package-Requires: (notmuch projectile)
;; Copyright (C) 2018, 2019 Sean Whitton
@@ -22,6 +22,7 @@
;;; Code:
(require 'notmuch)
+(require 'projectile)
(defgroup mailscripts nil
"Customisation of functions in the mailscripts package.")
@@ -70,6 +71,12 @@ threads to the notmuch-extract-patch(1) command."
(shell-quote-argument thread-id))
"*notmuch-apply-thread-series*")))
+;;;###autoload
+(defun notmuch-extract-thread-patches-projectile ()
+ "Like `notmuch-extract-thread-patches', but use projectile to choose the repo."
+ (interactive)
+ (mailscripts--projectile-repo-and-branch 'notmuch-extract-thread-patches))
+
(defun mailscripts--check-out-branch (branch)
(call-process-shell-command
(format "git checkout -b %s"
@@ -78,6 +85,12 @@ threads to the notmuch-extract-patch(1) command."
(concat mailscripts-extract-patches-branch-prefix branch)
branch)))))
+(defun mailscripts--projectile-repo-and-branch (f)
+ (let ((repo (projectile-completing-read
+ "Select projectile project: " projectile-known-projects))
+ (branch (completing-read "Branch name: " nil)))
+ (funcall f repo branch)))
+
(provide 'mailscripts)
;;; mailscripts.el ends here