aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2002-02-16 07:10:35 +0000
committerJohn Wiegley2002-02-16 07:10:35 +0000
commiteefd92208d757e9a2945e394bd6c729900a11413 (patch)
treef92876c4818af9258bd71ed599eb5aff6573b5e2
parentfc909dbbb9f2149ed86d43513703c8e020f9d064 (diff)
downloademacs-eefd92208d757e9a2945e394bd6c729900a11413.tar.gz
emacs-eefd92208d757e9a2945e394bd6c729900a11413.zip
(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 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."
397 (unwind-protect 397 (unwind-protect
398 (let ((eshell-non-interactive-p t)) 398 (let ((eshell-non-interactive-p t))
399 (add-hook 'minibuffer-setup-hook 'eshell-mode) 399 (add-hook 'minibuffer-setup-hook 'eshell-mode)
400 (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)
400 (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) 401 (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer)
401 (unless command 402 (unless command
402 (setq command (read-from-minibuffer "Emacs shell command: ")))) 403 (setq command (read-from-minibuffer "Emacs shell command: "))))
403 (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) 404 (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer)
405 (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)
404 (remove-hook 'minibuffer-setup-hook 'eshell-mode)) 406 (remove-hook 'minibuffer-setup-hook 'eshell-mode))
405 (unless command 407 (unless command
406 (error "No command specified!")) 408 (error "No command specified!"))