* shell.el (shell): For C-u M-x shell, use an inactive shell
buffer as the default.
Fixes: debbugs:1975
+2012-11-30 Chong Yidong <cyd@gnu.org>
+
+ * shell.el (shell): For C-u M-x shell, use an inactive shell
+ buffer as the default (Bug#1975).
+
2012-11-30 Yuriy Vostrikov <delamonpansie@gmail.com> (tiny change)
* vc/vc-git.el (vc-git-command): Disable the pager (Bug#6137).
(and current-prefix-arg
(prog1
(read-buffer "Shell buffer: "
- (generate-new-buffer-name "*shell*"))
+ ;; If the current buffer is an inactive
+ ;; shell buffer, use it as the default.
+ (if (and (eq major-mode 'shell-mode)
+ (null (get-buffer-process (current-buffer))))
+ (buffer-name)
+ (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