emacs-diffs
[Top][All Lists]
Advanced

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

master 70b64e0: Use pop-to-buffer-same-window for shell


From: Dmitry Gutov
Subject: master 70b64e0: Use pop-to-buffer-same-window for shell
Date: Sun, 21 Mar 2021 08:41:05 -0400 (EDT)

branch: master
commit 70b64e0d040e9c57f1a489c9ebee553264033119
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Use pop-to-buffer-same-window for shell
    
    * lisp/progmodes/project.el (project-shell): Behave the same way as
    'M-x project-eshell'.
    * lisp/shell.el (shell): Behave the same way as 'M-x eshell'.
    * etc/NEWS: Add news entry describing the change.
    * lisp/tutorial.el: Use lexical-binding.
---
 etc/NEWS                  | 4 ++++
 lisp/progmodes/project.el | 2 +-
 lisp/shell.el             | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index c602166..49a4bb8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2300,6 +2300,10 @@ since the latter uses 'M-s' as a prefix key of the 
search prefix map.
 ** 'vc-print-branch-log' shows the change log for BRANCH from its root
 directory instead of the default directory.
 
+---
+** 'project-shell' and 'shell' now use 'pop-to-buffer-same-window'.
+This is to keep the same behavior as Eshell.
+
 
 * Incompatible Lisp Changes in Emacs 28.1
 
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index bd552c9..b6a886f 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -911,7 +911,7 @@ if one already exists."
                    "-shell*"))
          (shell-buffer (get-buffer default-project-shell-name)))
     (if (and shell-buffer (not current-prefix-arg))
-        (pop-to-buffer shell-buffer)
+        (pop-to-buffer-same-window shell-buffer)
       (shell (generate-new-buffer-name default-project-shell-name)))))
 
 ;;;###autoload
diff --git a/lisp/shell.el b/lisp/shell.el
index 53f5d0b..7f4ca76 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -743,7 +743,7 @@ Make the shell buffer the current buffer, and return it.
                  (current-buffer)))
   ;; The buffer's window must be correctly set when we call comint
   ;; (so that comint sets the COLUMNS env var properly).
-  (pop-to-buffer buffer)
+  (pop-to-buffer-same-window buffer)
 
   (with-connection-local-variables
    ;; On remote hosts, the local `shell-file-name' might be useless.



reply via email to

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