]> git.eshelyaron.com Git - emacs.git/commitdiff
(shell): Use pop-to-buffer.
authorRichard M. Stallman <rms@gnu.org>
Sun, 12 Mar 1995 09:39:49 +0000 (09:39 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 12 Mar 1995 09:39:49 +0000 (09:39 +0000)
(same-window-buffer-names): Add *shell* to the list.

lisp/shell.el

index 9f07194d305c76718aec93fb9c6544a9b624e7fe..3d60af3f6d15f976153d579c72282a17ffdccccf 100644 (file)
@@ -365,15 +365,21 @@ Otherwise, one argument `-i' is passed to the shell.
                       "/bin/sh"))                   
             (name (file-name-nondirectory prog))
             (startfile (concat "~/.emacs_" name))
-            (xargs-name (intern-soft (concat "explicit-" name "-args"))))
-       (set-buffer (apply 'make-comint "shell" prog
-                          (if (file-exists-p startfile) startfile)
-                          (if (and xargs-name (boundp xargs-name))
-                              (symbol-value xargs-name)
-                            '("-i"))))
-       (shell-mode)
-       (switch-to-buffer (current-buffer)))
-    (switch-to-buffer "*shell*")))
+            (xargs-name (intern-soft (concat "explicit-" name "-args")))
+            shell-buffer)
+       (save-excursion
+         (set-buffer (apply 'make-comint "shell" prog
+                            (if (file-exists-p startfile) startfile)
+                            (if (and xargs-name (boundp xargs-name))
+                                (symbol-value xargs-name)
+                              '("-i"))))
+         (setq shell-buffer (current-buffer))
+         (shell-mode))
+       (pop-to-buffer shell-buffer))
+    (pop-to-buffer "*shell*")))
+
+;;; Don't do this when shell.el is loaded, only while dumping.
+;;;###autoload (add-hook 'same-window-buffer-names "*shell*")
 \f
 ;;; Directory tracking
 ;;; ===========================================================================