aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-11-23 09:19:54 -0500
committerStefan Monnier2010-11-23 09:19:54 -0500
commit8f5f1e686e457d046198a6894fd4eca2cf12aaae (patch)
tree840f4e26aac4566b2840ed3e59e876e731e8f7af
parenta299480856a08e59f7b88de2577534215d8aaf7b (diff)
downloademacs-8f5f1e686e457d046198a6894fd4eca2cf12aaae.tar.gz
emacs-8f5f1e686e457d046198a6894fd4eca2cf12aaae.zip
* 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>.
-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 @@
12010-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * shell.el (shell): Use current-buffer by default if it's already
4 a shell mode buffer and its process is dead.
5 Suggested by <jemarch@gnu.org>.
6
12010-11-23 Tassilo Horn <tassilo@member.fsf.org> 72010-11-23 Tassilo Horn <tassilo@member.fsf.org>
2 8
3 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Mention 9 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs):
4 that the keywords should be comma separated. 10 Mention that the keywords should be comma separated.
5 11
62010-11-23 Chong Yidong <cyd@stupidchicken.com> 122010-11-23 Chong Yidong <cyd@stupidchicken.com>
7 13
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.
554 (generate-new-buffer-name "*shell*")) 554 (generate-new-buffer-name "*shell*"))
555 (if (file-remote-p default-directory) 555 (if (file-remote-p default-directory)
556 ;; It must be possible to declare a local default-directory. 556 ;; It must be possible to declare a local default-directory.
557 ;; FIXME: This can't be right: it changes the default-directory
558 ;; of the current-buffer rather than of the *shell* buffer.
557 (setq default-directory 559 (setq default-directory
558 (expand-file-name 560 (expand-file-name
559 (read-file-name 561 (read-file-name
560 "Default directory: " default-directory default-directory 562 "Default directory: " default-directory default-directory
561 t nil 'file-directory-p)))))))) 563 t nil 'file-directory-p))))))))
562 (require 'ansi-color) 564 (require 'ansi-color)
563 (setq buffer (get-buffer-create (or buffer "*shell*"))) 565 (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode))
566 (comint-check-proc (current-buffer)))
567 (get-buffer-create (or buffer "*shell*"))
568 ;; If the current buffer is a dead shell buffer, use it.
569 (current-buffer)))
564 ;; Pop to buffer, so that the buffer's window will be correctly set 570 ;; Pop to buffer, so that the buffer's window will be correctly set
565 ;; when we call comint (so that comint sets the COLUMNS env var properly). 571 ;; when we call comint (so that comint sets the COLUMNS env var properly).
566 (pop-to-buffer buffer) 572 (pop-to-buffer buffer)