about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configs/shared/.emacs.d/wpc/prelude.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/configs/shared/.emacs.d/wpc/prelude.el b/configs/shared/.emacs.d/wpc/prelude.el
index 8bc2f283c7cf..d1031daa19a1 100644
--- a/configs/shared/.emacs.d/wpc/prelude.el
+++ b/configs/shared/.emacs.d/wpc/prelude.el
@@ -44,6 +44,12 @@
        (apply #'string/concat)
        message))
 
+(defmacro prelude/call-process-to-string (cmd &rest args)
+  "Return the string output of CMD called with ARGS."
+  `(with-temp-buffer
+     (call-process ,cmd nil (current-buffer) nil ,@args)
+     (buffer-string)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Assertions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;