summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorthierry volpiatto <thierry.volpiatto@gmail.com>2011-10-08 08:08:00 +0200
committerthierry volpiatto <thierry.volpiatto@gmail.com>2011-10-08 08:08:00 +0200
commit61a57ef48995138f7b798d979ff189751f0acbfc (patch)
tree68d5f3b37d357e4008d1b6b775425e1e44b596df /lisp/eshell
parentd47439a333a33e01ba4b6695e588fd4ded4fc611 (diff)
downloademacs-61a57ef48995138f7b798d979ff189751f0acbfc.tar.gz
emacs-61a57ef48995138f7b798d979ff189751f0acbfc.tar.bz2
emacs-61a57ef48995138f7b798d979ff189751f0acbfc.zip
* lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/eshell.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 08bb30d67ba..c33c2ccf9d1 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -344,16 +344,16 @@ With prefix ARG, insert output into the current buffer at point."
(require 'esh-cmd)
(unless arg
(setq arg current-prefix-arg))
- (unwind-protect
- (let ((eshell-non-interactive-p t))
- ;; Enable `eshell-mode' only in this minibuffer.
- (minibuffer-with-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))
+ (let ((eshell-non-interactive-p t))
+ ;; Enable `eshell-mode' only in this minibuffer.
+ (minibuffer-with-setup-hook #'(lambda ()
+ (eshell-mode)
+ (eshell-return-exits-minibuffer))
+ (unwind-protect
+ (unless command
+ (setq command (read-from-minibuffer "Emacs shell command: ")))
+ (when command
+ (eshell-add-input-to-history command)))))
(unless command
(error "No command specified!"))
;; redirection into the current buffer is achieved by adding an