emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106020: * lisp/eshell/eshell.el (esh


From: thierry volpiatto
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106020: * lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
Date: Sat, 08 Oct 2011 08:08:00 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106020
committer: thierry volpiatto <address@hidden
branch nick: trunk
timestamp: Sat 2011-10-08 08:08:00 +0200
message:
  * lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
modified:
  lisp/ChangeLog
  lisp/eshell/eshell.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-07 16:05:10 +0000
+++ b/lisp/ChangeLog    2011-10-08 06:08:00 +0000
@@ -1,3 +1,7 @@
+2011-10-08  Thierry Volpiatto  <address@hidden>
+
+       * lisp/eshell/eshell.el (eshell-command): Avoid using hooks.
+
 2011-10-07  Chong Yidong  <address@hidden>
 
        * bindings.el ([M-left],[M-right]): Bind to left-word and

=== modified file 'lisp/eshell/eshell.el'
--- a/lisp/eshell/eshell.el     2011-10-06 15:18:48 +0000
+++ b/lisp/eshell/eshell.el     2011-10-08 06:08:00 +0000
@@ -344,16 +344,16 @@
   (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]