aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthierry volpiatto2011-10-08 08:08:00 +0200
committerthierry volpiatto2011-10-08 08:08:00 +0200
commit61a57ef48995138f7b798d979ff189751f0acbfc (patch)
tree68d5f3b37d357e4008d1b6b775425e1e44b596df
parentd47439a333a33e01ba4b6695e588fd4ded4fc611 (diff)
downloademacs-61a57ef48995138f7b798d979ff189751f0acbfc.tar.gz
emacs-61a57ef48995138f7b798d979ff189751f0acbfc.zip
* lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/eshell/eshell.el20
2 files changed, 14 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6c32655d96c..fdc61721a13 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12011-10-08 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2
3 * lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
4
12011-10-07 Chong Yidong <cyd@stupidchicken.com> 52011-10-07 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * bindings.el ([M-left],[M-right]): Bind to left-word and 7 * bindings.el ([M-left],[M-right]): Bind to left-word and
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."
344 (require 'esh-cmd) 344 (require 'esh-cmd)
345 (unless arg 345 (unless arg
346 (setq arg current-prefix-arg)) 346 (setq arg current-prefix-arg))
347 (unwind-protect 347 (let ((eshell-non-interactive-p t))
348 (let ((eshell-non-interactive-p t)) 348 ;; Enable `eshell-mode' only in this minibuffer.
349 ;; Enable `eshell-mode' only in this minibuffer. 349 (minibuffer-with-setup-hook #'(lambda ()
350 (minibuffer-with-setup-hook 'eshell-mode 350 (eshell-mode)
351 (add-hook 'minibuffer-exit-hook 'eshell-add-command-to-history) 351 (eshell-return-exits-minibuffer))
352 (add-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) 352 (unwind-protect
353 (unless command 353 (unless command
354 (setq command (read-from-minibuffer "Emacs shell command: "))))) 354 (setq command (read-from-minibuffer "Emacs shell command: ")))
355 (remove-hook 'eshell-mode-hook 'eshell-return-exits-minibuffer) 355 (when command
356 (remove-hook 'minibuffer-exit-hook 'eshell-add-command-to-history)) 356 (eshell-add-input-to-history command)))))
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