Support call-process-to-string
Writes an Elisp macro to use `call-process` (because it's fast) but capture the output to a string.
This commit is contained in:
parent
34c9d74335
commit
438ff66eed
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Reference in a new issue