From: thierry volpiatto Date: Thu, 6 Oct 2011 15:18:48 +0000 (+0200) Subject: * lisp/eshell/eshell.el (eshell-command): Enable `eshell-mode' only in current minibu... X-Git-Tag: emacs-pretest-24.0.91~199^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=695abac19f210c1de4999ff56cdf548b05172fc5;p=emacs.git * lisp/eshell/eshell.el (eshell-command): Enable `eshell-mode' only in current minibuffer (Fix bug with recursive minibuffers). --- diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 1a9d7c97b83..08bb30d67ba 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -346,14 +346,14 @@ With prefix ARG, insert output into the current buffer at point." (setq arg current-prefix-arg)) (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: ")))) + ;; 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) - (remove-hook 'minibuffer-setup-hook 'eshell-mode)) + (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)) (unless command (error "No command specified!")) ;; redirection into the current buffer is achieved by adding an