Function: eshell-set-output-handle
eshell-set-output-handle is a byte-compiled function defined in
esh-io.el.gz.
Signature
(eshell-set-output-handle INDEX MODE &optional TARGET HANDLES)
Documentation
Set handle INDEX for the current HANDLES to point to TARGET using MODE.
If HANDLES is nil, use eshell-current-handles.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-io.el.gz
(defun eshell-set-output-handle (index mode &optional target handles)
"Set handle INDEX for the current HANDLES to point to TARGET using MODE.
If HANDLES is nil, use `eshell-current-handles'."
(when target
(let ((handles (or handles eshell-current-handles)))
(if (and (stringp target)
;; The literal string "/dev/null" is intentional here.
;; It just provides compatibility so that users can
;; redirect to "/dev/null" no matter the actual value
;; of `null-device'.
(string= target "/dev/null"))
(aset handles index nil)
(let ((where (eshell-get-target target mode))
(current (car (aref handles index))))
(if (listp current)
(unless (member where current)
(setq current (append current (list where))))
(setq current (list where)))
(if (not (aref handles index))
(aset handles index (cons nil 1)))
(setcar (aref handles index) current))))))