Function: eshell-do-pipelines-synchronously
eshell-do-pipelines-synchronously is a macro defined in esh-cmd.el.gz.
Signature
(eshell-do-pipelines-synchronously PIPELINE)
Documentation
Execute the commands in PIPELINE in sequence synchronously.
This collects the output of each command in turn, passing it as input to the next one in the pipeline. Returns the result of the first command invocation in the pipeline (usually t or nil).
This is used on systems where async subprocesses are not supported.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
(defmacro eshell-do-pipelines-synchronously (pipeline)
"Execute the commands in PIPELINE in sequence synchronously.
This collects the output of each command in turn, passing it as
input to the next one in the pipeline. Returns the result of the
first command invocation in the pipeline (usually t or nil).
This is used on systems where async subprocesses are not
supported."
(when (setq pipeline (cadr pipeline))
`(prog1
(eshell-with-copied-handles
(progn
,(when (cdr pipeline)
`(let ((output-marker ,(point-marker)))
(eshell-set-output-handle ,eshell-output-handle
'append output-marker)))
(let (;; XXX: `eshell-in-pipeline-p' has a different
;; meaning for synchronous processes: it's non-nil
;; only when piping *to* a process.
(eshell-in-pipeline-p ,(and (cdr pipeline) t)))
,(car pipeline))))
,(when (cdr pipeline)
`(eshell-do-pipelines-synchronously (quote ,(cdr pipeline)))))))