aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley <[email protected]>2002-02-16 07:10:35 +0000
committerJohn Wiegley <[email protected]>2002-02-16 07:10:35 +0000
commiteefd92208d757e9a2945e394bd6c729900a11413 (patch)
treef92876c4818af9258bd71ed599eb5aff6573b5e2
parentfc909dbbb9f2149ed86d43513703c8e020f9d064 (diff)
(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.
-rw-r--r--lisp/eshell/eshell.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 7515f1792c..106a161f8f 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!"))