From eefd92208d757e9a2945e394bd6c729900a11413 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 16 Feb 2002 07:10:35 +0000 Subject: [PATCH] (eshell-command): Before reading from the minibuffer, add eshell-add-command-to-history to minibuffer-exit-hook, and remove it after read-from-minibuffer returns. --- lisp/eshell/eshell.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 7515f1792c9..106a161f8fb 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -397,10 +397,12 @@ With prefix ARG, insert output into the current buffer at point." (unwind-protect (let ((eshell-non-interactive-p t)) (add-hook 'minibuffer-setup-hook 'eshell-mode) + (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) (unless command (setq command (read-from-minibuffer "Emacs shell command: ")))) (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) + (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) (remove-hook 'minibuffer-setup-hook 'eshell-mode)) (unless command (error "No command specified!")) -- 2.39.2