emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111038: Improve buffer name default


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111038: Improve buffer name default for C-u M-x shell.
Date: Fri, 30 Nov 2012 16:06:04 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111038
fixes bug: http://debbugs.gnu.org/1975
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Fri 2012-11-30 16:06:04 +0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/shell.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-30 07:43:05 +0000
+++ b/lisp/ChangeLog    2012-11-30 08:06:04 +0000
@@ -1,3 +1,8 @@
+2012-11-30  Chong Yidong  <address@hidden>
+
+       * shell.el (shell): For C-u M-x shell, use an inactive shell
+       buffer as the default (Bug#1975).
+
 2012-11-30  Yuriy Vostrikov  <address@hidden>  (tiny change)
 
        * vc/vc-git.el (vc-git-command): Disable the pager (Bug#6137).

=== modified file 'lisp/shell.el'
--- a/lisp/shell.el     2012-09-17 05:41:04 +0000
+++ b/lisp/shell.el     2012-11-30 08:06:04 +0000
@@ -671,7 +671,12 @@
     (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]