diff options
| -rw-r--r-- | lisp/eshell/eshell.el | 14 |
1 files changed, 7 insertions, 7 deletions
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." | |||
| 346 | (setq arg current-prefix-arg)) | 346 | (setq arg current-prefix-arg)) |
| 347 | (unwind-protect | 347 | (unwind-protect |
| 348 | (let ((eshell-non-interactive-p t)) | 348 | (let ((eshell-non-interactive-p t)) |
| 349 | (add-hook 'minibuffer-setup-hook 'eshell-mode) | 349 | ;; Enable `eshell-mode' only in this minibuffer. |
| 350 | (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) | 350 | (minibuffer-with-setup-hook 'eshell-mode |
| 351 | (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) | 351 | (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) |
| 352 | (unless command | 352 | (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) |
| 353 | (setq command (read-from-minibuffer "Emacs shell command: ")))) | 353 | (unless command |
| 354 | (setq command (read-from-minibuffer "Emacs shell command: "))))) | ||
| 354 | (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) | 355 | (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) |
| 355 | (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) | 356 | (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)) |
| 356 | (remove-hook 'minibuffer-setup-hook 'eshell-mode)) | ||
| 357 | (unless command | 357 | (unless command |
| 358 | (error "No command specified!")) | 358 | (error "No command specified!")) |
| 359 | ;; redirection into the current buffer is achieved by adding an | 359 | ;; redirection into the current buffer is achieved by adding an |