functions: Overhaul call-process-to-string

master
Pierre Neidhardt 2019-03-03 13:23:05 +01:00
parent 17af8f4373
commit 853ef85b3f
1 changed files with 7 additions and 3 deletions

View File

@ -25,12 +25,16 @@
;; (interactive "r")
;; ...
;; TODO: Use `process-lines' instead.
(defun ambrevar/call-process-to-string (program &rest args)
"Call PROGRAM with ARGS and return output."
"Call PROGRAM with ARGS and return output.
See also `process-lines'."
;; Or equivalently:
;; (with-temp-buffer
;; (apply 'process-file program nil t nil args)
;; (buffer-string))
(with-output-to-string
(with-current-buffer standard-output
(apply 'call-process program nil t nil args))))
(apply 'process-file program nil t nil args))))
(defun ambrevar/define-keys (map key def &rest bindings)
"Like `define-key' but allow for defining several bindings at once.