]> git.eshelyaron.com Git - emacs.git/commitdiff
(eshell-command): Before reading from the minibuffer, add
authorJohn Wiegley <johnw@newartisans.com>
Sat, 16 Feb 2002 07:10:35 +0000 (07:10 +0000)
committerJohn Wiegley <johnw@newartisans.com>
Sat, 16 Feb 2002 07:10:35 +0000 (07:10 +0000)
eshell-add-command-to-history to minibuffer-exit-hook, and remove it
after read-from-minibuffer returns.

lisp/eshell/eshell.el

index 7515f1792c94b90742329a79529f2717b5690f21..106a161f8fb7c54659c16e47d16d1daf179c3e9e 100644 (file)
@@ -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!"))