>From 711eaaf2c64b4e5aa9b49d147771a299fc31f81d Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sat, 20 Mar 2021 22:46:42 +0100 Subject: [PATCH] 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' --- lisp/progmodes/project.el | 2 +- lisp/shell.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index bd552c917a..b6a886f731 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 53f5d0b6f1..7f4ca76547 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. -- 2.24.3 (Apple Git-128)