From afbeea2ac293f794456a4145e1620538d499dc11 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 27 Jun 2020 17:11:29 -0400 Subject: piem-am: Move git-am arguments to variable It's tempting to define a transient for piem-am and let that handle the arguments, but doing so only takes care of the case where piem-am is the entrypoint, not piem-b4-am---which is already a transient with b4 arguments. And it's not yet clear whether many users will need to modify that these arguments across different calls (e.g., based on conventions across different projects). For my purposes, a single set of arguments is fine. For now, add a defvar so that there's at least something to latch onto if someone needs to modify the arguments unconditionally or via a let-binding. --- piem.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/piem.el b/piem.el index 145d4aa..6551c82 100644 --- a/piem.el +++ b/piem.el @@ -521,6 +521,8 @@ in `piem-default-branch-function'." (piem--shorten-subject subject) (and version (concat "__" version)))))) +(defvar piem-am-args (list "--scissors")) + ;;;###autoload (defun piem-am (mbox &optional info coderepo) "Feed an am-ready mbox to `git am'. @@ -558,9 +560,10 @@ If CODEREPO is given, switch to this directory before calling (and (not (string-blank-p base)) (list base))))) (if (bufferp mbox) - (piem-process-call-with-buffer-input - nil mbox piem-git-executable "am" "--scissors") - (piem-process-call nil piem-git-executable "am" "--scissors" mbox)) + (apply #'piem-process-call-with-buffer-input + nil mbox piem-git-executable "am" piem-am-args) + (apply #'piem-process-call nil piem-git-executable "am" + (append piem-am-args (list mbox)))) (if (and piem-use-magit (fboundp 'magit-status-setup-buffer)) (magit-status-setup-buffer) -- cgit v1.2.3