Function: eshell-do-subjob
eshell-do-subjob is a macro defined in esh-cmd.el.gz.
Signature
(eshell-do-subjob OBJECT)
Documentation
Evaluate a command OBJECT as a subjob.
We indicate that the process was run in the background by returning it as (:eshell-background . PROCESSES).
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
;;_* Command evaluation macros
;;
;; The structure of the following macros is very important to
;; `eshell-do-eval' [Iterative evaluation]:
;;
;; @ Don't use special forms that conditionally evaluate their
;; arguments, such as `let*', unless Eshell explicitly supports
;; them. Eshell supports the following special forms: `catch',
;; `condition-case', `if', `let', `prog1', `progn', `quote', `setq',
;; `unwind-protect', and `while'.
;;
;; @ The two `special' variables are `eshell-current-handles' and
;; `eshell-current-subjob-p'. Bind them locally with a `let' if you
;; need to change them. Change them directly only if your intention
;; is to change the calling environment.
;;
;; These rules likewise apply to any other code that generates forms
;; that `eshell-do-eval' will evaluated, such as command rewriting
;; hooks (see `eshell-rewrite-command-hook' and friends).
(defmacro eshell-do-subjob (object)
"Evaluate a command OBJECT as a subjob.
We indicate that the process was run in the background by
returning it as (:eshell-background . PROCESSES)."
`(let ((eshell-current-subjob-p t)
;; Print subjob messages. This could have been cleared
;; (e.g. by `eshell-source-file', which see).
(eshell-subjob-messages t))
(eshell-resume-eval (eshell-add-command ',object 'background))))