Function: eshell/eshell-debug
eshell/eshell-debug is a byte-compiled function defined in
esh-cmd.el.gz.
Signature
(eshell/eshell-debug &rest ARGS)
Documentation
A command for toggling certain debug variables.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
;;;_* Iterative evaluation
;;
;; Eshell runs all of its external commands asynchronously, so that
;; Emacs is not blocked while the operation is being performed.
;; However, this introduces certain synchronization difficulties,
;; since the Lisp code, once it returns, will not "go back" to finish
;; executing the commands which haven't yet been started.
;;
;; What Eshell does to work around this problem (basically, the lack
;; of threads in Lisp), is that it evaluates the command sequence
;; iteratively. Whenever an asynchronous process is begun, evaluation
;; terminates and control is given back to Emacs. When that process
;; finishes, it will resume the evaluation using the remainder of the
;; command tree.
(defun eshell/eshell-debug (&rest args)
"A command for toggling certain debug variables."
(ignore
(cond
((not args)
(if eshell-handle-errors
(eshell-print "errors\n"))
(if eshell-debug-command
(eshell-print "commands\n")))
((member (car args) '("-h" "--help"))
(eshell-print "usage: eshell-debug [kinds]
This command is used to aid in debugging problems related to Eshell
itself. It is not useful for anything else. The recognized `kinds'
at the moment are:
errors stops Eshell from trapping errors
commands shows command execution progress in `*eshell last cmd*'
"))
(t
(while args
(cond
((string= (car args) "errors")
(setq eshell-handle-errors (not eshell-handle-errors)))
((string= (car args) "commands")
(setq eshell-debug-command (not eshell-debug-command))))
(setq args (cdr args)))))))