aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell/em-basic.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/eshell/em-basic.el')
-rw-r--r--lisp/eshell/em-basic.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/lisp/eshell/em-basic.el b/lisp/eshell/em-basic.el
index 016afe811b2..554ee83b015 100644
--- a/lisp/eshell/em-basic.el
+++ b/lisp/eshell/em-basic.el
@@ -188,6 +188,37 @@ or `eshell-printn' for display."
188 188
189(put 'eshell/umask 'eshell-no-numeric-conversions t) 189(put 'eshell/umask 'eshell-no-numeric-conversions t)
190 190
191(defun eshell/eshell-debug (&rest args)
192 "A command for toggling certain debug variables."
193 (eshell-eval-using-options
194 "eshell-debug" args
195 '((?h "help" nil nil "display this usage message")
196 :usage "[KIND]...
197This command is used to aid in debugging problems related to Eshell
198itself. It is not useful for anything else. The recognized `kinds'
199are:
200
201 error stops Eshell from trapping errors
202 form shows command form manipulation in `*eshell last cmd*'")
203 (if args
204 (dolist (kind args)
205 (if (equal kind "error")
206 (setq eshell-handle-errors (not eshell-handle-errors))
207 (let ((kind-sym (intern kind)))
208 (if (memq kind-sym eshell-debug-command)
209 (setq eshell-debug-command
210 (delq kind-sym eshell-debug-command))
211 (push kind-sym eshell-debug-command)))))
212 ;; Output the currently-enabled debug kinds.
213 (unless eshell-handle-errors
214 (eshell-print "errors\n"))
215 (dolist (kind eshell-debug-command)
216 (eshell-printn (symbol-name kind))))))
217
218(defun pcomplete/eshell-mode/eshell-debug ()
219 "Completion for the `debug' command."
220 (while (pcomplete-here '("error" "form"))))
221
191(provide 'em-basic) 222(provide 'em-basic)
192 223
193;; Local Variables: 224;; Local Variables: