diff options
| author | Chong Yidong | 2012-11-30 16:06:04 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-11-30 16:06:04 +0800 |
| commit | a813fe3fb8d13abe234169361ba2c5b0c747c5e9 (patch) | |
| tree | ef1a7a90dba9a6a50b7eed21fcb86eaa92d65a40 | |
| parent | a8b733a51903ddcffcab727edd0f386a44a24313 (diff) | |
| download | emacs-a813fe3fb8d13abe234169361ba2c5b0c747c5e9.tar.gz emacs-a813fe3fb8d13abe234169361ba2c5b0c747c5e9.zip | |
Improve buffer name default for C-u M-x shell.
* shell.el (shell): For C-u M-x shell, use an inactive shell
buffer as the default.
Fixes: debbugs:1975
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/shell.el | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5740d796f3e..4a128e10925 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-11-30 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * shell.el (shell): For C-u M-x shell, use an inactive shell | ||
| 4 | buffer as the default (Bug#1975). | ||
| 5 | |||
| 1 | 2012-11-30 Yuriy Vostrikov <delamonpansie@gmail.com> (tiny change) | 6 | 2012-11-30 Yuriy Vostrikov <delamonpansie@gmail.com> (tiny change) |
| 2 | 7 | ||
| 3 | * vc/vc-git.el (vc-git-command): Disable the pager (Bug#6137). | 8 | * vc/vc-git.el (vc-git-command): Disable the pager (Bug#6137). |
diff --git a/lisp/shell.el b/lisp/shell.el index 77a42389785..38273311b61 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -671,7 +671,12 @@ Otherwise, one argument `-i' is passed to the shell. | |||
| 671 | (and current-prefix-arg | 671 | (and current-prefix-arg |
| 672 | (prog1 | 672 | (prog1 |
| 673 | (read-buffer "Shell buffer: " | 673 | (read-buffer "Shell buffer: " |
| 674 | (generate-new-buffer-name "*shell*")) | 674 | ;; If the current buffer is an inactive |
| 675 | ;; shell buffer, use it as the default. | ||
| 676 | (if (and (eq major-mode 'shell-mode) | ||
| 677 | (null (get-buffer-process (current-buffer)))) | ||
| 678 | (buffer-name) | ||
| 679 | (generate-new-buffer-name "*shell*"))) | ||
| 675 | (if (file-remote-p default-directory) | 680 | (if (file-remote-p default-directory) |
| 676 | ;; It must be possible to declare a local default-directory. | 681 | ;; It must be possible to declare a local default-directory. |
| 677 | ;; FIXME: This can't be right: it changes the default-directory | 682 | ;; FIXME: This can't be right: it changes the default-directory |