Function: eshell-execute-file
eshell-execute-file is an autoloaded and byte-compiled function
defined in em-script.el.gz.
Signature
(eshell-execute-file FILE &optional ARGS DESTINATION)
Documentation
Execute a series of Eshell commands in FILE, passing ARGS.
If DESTINATION is t, write the command output to the current buffer. If
nil, don't write the output anywhere. For any other value, output to
the corresponding Eshell target (see eshell-get-target).
Comments begin with #.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/em-script.el.gz
;;;###autoload
(defun eshell-execute-file (file &optional args destination)
"Execute a series of Eshell commands in FILE, passing ARGS.
If DESTINATION is t, write the command output to the current buffer. If
nil, don't write the output anywhere. For any other value, output to
the corresponding Eshell target (see `eshell-get-target').
Comments begin with `#'."
(let ((eshell-non-interactive-p t)
(stdout (if (eq destination t) (current-buffer) destination)))
(with-temp-buffer
(eshell-mode)
(eshell-do-eval
`(let ((eshell-current-handles
(eshell-create-handles ',stdout 'insert))
(eshell-current-subjob-p))
,(eshell--source-file file args))
t))))