summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-11-23 09:19:54 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2010-11-23 09:19:54 -0500
commit8f5f1e686e457d046198a6894fd4eca2cf12aaae (patch)
tree840f4e26aac4566b2840ed3e59e876e731e8f7af /lisp
parenta299480856a08e59f7b88de2577534215d8aaf7b (diff)
downloademacs-8f5f1e686e457d046198a6894fd4eca2cf12aaae.tar.gz
* lisp/shell.el (shell): Use current-buffer by default if it's already
a shell mode buffer and its process is dead. Suggested by <jemarch@gnu.org>.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/shell.el8
2 files changed, 15 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e6a33d39708..052ef61687c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,13 @@
+2010-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * shell.el (shell): Use current-buffer by default if it's already
+ a shell mode buffer and its process is dead.
+ Suggested by <jemarch@gnu.org>.
+
2010-11-23 Tassilo Horn <tassilo@member.fsf.org>
- * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Mention
- that the keywords should be comma separated.
+ * mail/emacsbug.el (report-emacs-bug-query-existing-bugs):
+ Mention that the keywords should be comma separated.
2010-11-23 Chong Yidong <cyd@stupidchicken.com>
diff --git a/lisp/shell.el b/lisp/shell.el
index 7771c0d1c4f..4288834e029 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -554,13 +554,19 @@ Otherwise, one argument `-i' is passed to the shell.
(generate-new-buffer-name "*shell*"))
(if (file-remote-p default-directory)
;; It must be possible to declare a local default-directory.
+ ;; FIXME: This can't be right: it changes the default-directory
+ ;; of the current-buffer rather than of the *shell* buffer.
(setq default-directory
(expand-file-name
(read-file-name
"Default directory: " default-directory default-directory
t nil 'file-directory-p))))))))
(require 'ansi-color)
- (setq buffer (get-buffer-create (or buffer "*shell*")))
+ (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode))
+ (comint-check-proc (current-buffer)))
+ (get-buffer-create (or buffer "*shell*"))
+ ;; If the current buffer is a dead shell buffer, use it.
+ (current-buffer)))
;; 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)