summaryrefslogtreecommitdiff
path: root/piem.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-06-06 12:26:44 -0400
committerKyle Meyer <kyle@kyleam.com>2020-06-06 15:14:22 -0400
commitb410f5acc57d42a323e9f828790c774b9d2138ce (patch)
tree6c8079a061628ff9c9df53911acf9b1a317dc26f /piem.el
parentcdb845f4f8210a5535bb7459dcdd761d2c08a0ac (diff)
downloadpiem-b410f5acc57d42a323e9f828790c774b9d2138ce.tar.gz
Add piem-process- variant that accepts a buffer for stdin
This will be used to feed git-am the buffer returned by piem-am-ready-mbox.
Diffstat (limited to 'piem.el')
-rw-r--r--piem.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/piem.el b/piem.el
index 35bfe8f..b095bf1 100644
--- a/piem.el
+++ b/piem.el
@@ -230,6 +230,22 @@ the following information about the patch series:
(list (format "%s call in %s failed"
program default-directory)))))))
+(defun piem-process-call-with-buffer-input
+ (dir buffer program &rest program-args)
+ (setq program-args (remq nil program-args))
+ (piem--process-go
+ dir program program-args
+ (lambda ()
+ (let ((outdir default-directory)
+ (outbuf (current-buffer)))
+ (with-current-buffer buffer
+ (let ((default-directory outdir))
+ (unless (= 0 (apply #'call-process-region nil nil
+ program nil outbuf nil program-args))
+ (signal 'piem-process-error
+ (list (format "%s call in %s failed"
+ program default-directory))))))))))
+
;;;; Extractors