* lisp/eshell/eshell.el (eshell-command): History have to be saved only in interactiv...
[bpt/emacs.git] / lisp / eshell / eshell.el
index c33c2cc..0c1c039 100644 (file)
@@ -349,11 +349,9 @@ With prefix ARG, insert output into the current buffer at point."
     (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
+        (setq command (read-from-minibuffer "Emacs shell command: "))
+        (eshell-add-input-to-history command))))
   (unless command
     (error "No command specified!"))
   ;; redirection into the current buffer is achieved by adding an