486 |
(list |
(list |
487 |
(and current-prefix-arg |
(and current-prefix-arg |
488 |
(read-buffer "Shell buffer: " "*shell*")))) |
(read-buffer "Shell buffer: " "*shell*")))) |
489 |
(when (null buffer) |
(setq buffer (get-buffer-create (or buffer "*shell*"))) |
490 |
(setq buffer "*shell*")) |
;; Pop to buffer, so that the buffer's window will be correctly set |
491 |
(if (not (comint-check-proc buffer)) |
;; when we call comint (so that comint sets the COLUMNS env var properly). |
492 |
(let* ((prog (or explicit-shell-file-name |
(pop-to-buffer buffer) |
493 |
(getenv "ESHELL") |
(unless (comint-check-proc buffer) |
494 |
(getenv "SHELL") |
(let* ((prog (or explicit-shell-file-name |
495 |
"/bin/sh")) |
(getenv "ESHELL") shell-file-name)) |
496 |
(name (file-name-nondirectory prog)) |
(name (file-name-nondirectory prog)) |
497 |
(startfile (concat "~/.emacs_" name)) |
(startfile (concat "~/.emacs_" name)) |
498 |
(xargs-name (intern-soft (concat "explicit-" name "-args"))) |
(xargs-name (intern-soft (concat "explicit-" name "-args")))) |
499 |
shell-buffer) |
(apply 'make-comint-in-buffer "shell" buffer prog |
500 |
(save-excursion |
(if (file-exists-p startfile) startfile) |
501 |
(set-buffer (apply 'make-comint-in-buffer "shell" buffer prog |
(if (and xargs-name (boundp xargs-name)) |
502 |
(if (file-exists-p startfile) startfile) |
(symbol-value xargs-name) |
503 |
(if (and xargs-name (boundp xargs-name)) |
'("-i"))) |
504 |
(symbol-value xargs-name) |
(shell-mode))) |
505 |
'("-i")))) |
buffer) |
|
(setq shell-buffer (current-buffer)) |
|
|
(shell-mode)) |
|
|
(pop-to-buffer shell-buffer)) |
|
|
(pop-to-buffer buffer))) |
|
506 |
|
|
507 |
;;; Don't do this when shell.el is loaded, only while dumping. |
;;; Don't do this when shell.el is loaded, only while dumping. |
508 |
;;;###autoload (add-hook 'same-window-buffer-names "*shell*") |
;;;###autoload (add-hook 'same-window-buffer-names "*shell*") |