summaryrefslogtreecommitdiff
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
parent8d2dcb9d14a681c3ba86dc2f67756a5619f4d10d (diff)
downloadmailscripts-cb53ee3309fb20492bdb2d43c4596ed507140701.tar.gz
mailscripts.el: add notmuch-extract-thread-patches-projectile
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--debian/changelog1
-rw-r--r--mailscripts.el15
2 files changed, 15 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 6f57add..52c4282 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ mailscripts (0.12-1) UNRELEASED; urgency=medium
(Closes: #943959).
Thanks to Daniel Kahn Gillmor for the patch series.
* mailscripts.el: add mailscripts-extract-patches-branch-prefix defcustom.
+ * mailscripts.el: add notmuch-extract-thread-patches-projectile command.
-- Sean Whitton <spwhitton@spwhitton.name> Fri, 01 Nov 2019 20:38:07 -0700
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