Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
5a45735a
Commit
5a45735a
authored
Dec 02, 2001
by
Stefan Monnier
Browse files
(shell): Use shell-file-name.
Pop to buffer before calling comint to set COLUMNS properly.
parent
686d0681
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
lisp/shell.el
lisp/shell.el
+17
-21
No files found.
lisp/shell.el
View file @
5a45735a
...
...
@@ -486,27 +486,23 @@ Otherwise, one argument `-i' is passed to the shell.
(
list
(
and
current-prefix-arg
(
read-buffer
"Shell buffer: "
"*shell*"
))))
(
when
(
null
buffer
)
(
setq
buffer
"*shell*"
))
(
if
(
not
(
comint-check-proc
buffer
))
(
let*
((
prog
(
or
explicit-shell-file-name
(
getenv
"ESHELL"
)
(
getenv
"SHELL"
)
"/bin/sh"
))
(
name
(
file-name-nondirectory
prog
))
(
startfile
(
concat
"~/.emacs_"
name
))
(
xargs-name
(
intern-soft
(
concat
"explicit-"
name
"-args"
)))
shell-buffer
)
(
save-excursion
(
set-buffer
(
apply
'make-comint-in-buffer
"shell"
buffer
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
buffer
)))
(
setq
buffer
(
get-buffer-create
(
or
buffer
"*shell*"
)))
;; Pop to buffer, so that the buffer's window will be correctly set
;; when we call comint (so that comint sets the COLUMNS env var properly).
(
pop-to-buffer
buffer
)
(
unless
(
comint-check-proc
buffer
)
(
let*
((
prog
(
or
explicit-shell-file-name
(
getenv
"ESHELL"
)
shell-file-name
))
(
name
(
file-name-nondirectory
prog
))
(
startfile
(
concat
"~/.emacs_"
name
))
(
xargs-name
(
intern-soft
(
concat
"explicit-"
name
"-args"
))))
(
apply
'make-comint-in-buffer
"shell"
buffer
prog
(
if
(
file-exists-p
startfile
)
startfile
)
(
if
(
and
xargs-name
(
boundp
xargs-name
))
(
symbol-value
xargs-name
)
'
(
"-i"
)))
(
shell-mode
)))
buffer
)
;;; Don't do this when shell.el is loaded, only while dumping.
;;;###autoload (add-hook 'same-window-buffer-names "*shell*")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment