diff options
Diffstat (limited to 'mailscripts.el')
-rw-r--r-- | mailscripts.el | 15 |
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 |