summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-03-12 09:39:49 +0000
committerRichard M. Stallman <rms@gnu.org>1995-03-12 09:39:49 +0000
commite974774e1b10dab949a34962950e45c32ca157bc (patch)
tree78d23f5b503bb56585925e0424dacf59e21cf3ae /lisp/shell.el
parente3441dbe7c0341d70572426100b0783e666a2703 (diff)
downloademacs-e974774e1b10dab949a34962950e45c32ca157bc.tar.gz
(shell): Use pop-to-buffer.
(same-window-buffer-names): Add *shell* to the list.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el24
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 9f07194d305..3d60af3f6d1 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -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*")
;;; Directory tracking
;;; ===========================================================================