]> git.eshelyaron.com Git - emacs.git/commitdiff
(eshell): Avoid warnings about eshell-mode.
authorRichard M. Stallman <rms@gnu.org>
Tue, 9 Aug 2005 11:37:32 +0000 (11:37 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 9 Aug 2005 11:37:32 +0000 (11:37 +0000)
lisp/eshell/eshell.el

index 8c13b485cc247bbe8c54d0b016999ea2591fb2e4..ce9641026c7fda536a62be788ee4a2097a22e4e0 100644 (file)
@@ -374,11 +374,10 @@ buffer selected (or created)."
     ;; `same-window-buffer-names', which is done when Eshell is loaded
     (assert (and buf (buffer-live-p buf)))
     (pop-to-buffer buf)
-    (unless (fboundp 'eshell-mode)
+    (if (fboundp 'eshell-mode)
+       (unless (eq major-mode 'eshell-mode)
+         (eshell-mode))
       (error "`eshell-auto' must be loaded before Eshell can be used"))
-    (unless (eq major-mode 'eshell-mode)
-      (eshell-mode))
-    (assert (eq major-mode 'eshell-mode))
     buf))
 
 (defun eshell-return-exits-minibuffer ()