From b410f5acc57d42a323e9f828790c774b9d2138ce Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 6 Jun 2020 12:26:44 -0400 Subject: 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. --- piem.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'piem.el') 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 -- cgit v1.2.3