Commit 61a57ef4 authored by thierry volpiatto's avatar thierry volpiatto
Browse files

* lisp/eshell/eshell.el (eshell-command): Avoid using hooks.

parent d47439a3
2011-10-08 Thierry Volpiatto <thierry.volpiatto@gmail.com>
* lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
2011-10-07 Chong Yidong <cyd@stupidchicken.com>
* bindings.el ([M-left],[M-right]): Bind to left-word and
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment