From cb53ee3309fb20492bdb2d43c4596ed507140701 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 2 Nov 2019 10:06:39 -0700 Subject: mailscripts.el: add notmuch-extract-thread-patches-projectile Signed-off-by: Sean Whitton --- debian/changelog | 1 + mailscripts.el | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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 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 ;; 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 -- cgit v1.2.3