From acdb77c28947f0349e63fdb9759c90729b64956b Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Mon, 18 Sep 2023 18:00:07 -0700 Subject: [PATCH] ; Add debug instrumention for queueing commands in Eshell * lisp/eshell/esh-cmd.el (eshell-eval-command): Log the new command form. --- lisp/eshell/esh-cmd.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index af50a485226..b4d9b044a7b 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -990,15 +990,19 @@ process(es) in a cons cell like: (:eshell-background . PROCESS)" (if eshell-current-command - ;; We can just stick the new command at the end of the current - ;; one, and everything will happen as it should. - (setcdr (last (cdr eshell-current-command)) - (list `(let ((here (and (eobp) (point)))) - ,(and input - `(insert-and-inherit ,(concat input "\n"))) - (if here - (eshell-update-markers here)) - (eshell-do-eval ',command)))) + (progn + ;; We can just stick the new command at the end of the current + ;; one, and everything will happen as it should. + (setcdr (last (cdr eshell-current-command)) + (list `(let ((here (and (eobp) (point)))) + ,(and input + `(insert-and-inherit ,(concat input "\n"))) + (if here + (eshell-update-markers here)) + (eshell-do-eval ',command)))) + (eshell-debug-command 'form + "enqueued command form for %S\n\n%s" + (or input "") (eshell-stringify eshell-current-command))) (eshell-debug-command-start input) (setq eshell-current-command command) (let* (result -- 2.39.2