(inferior-scheme-mode)))
(setq scheme-program-name cmd)
(setq scheme-buffer "*scheme*")
- (pop-to-buffer-same-window "*scheme*"))
+ (pop-to-buffer "*scheme*" display-comint-buffer-action))
(defun scheme-start-file (prog)
"Return the name of the start file corresponding to PROG.
(interactive "P")
(if (or (and scheme-buffer (get-buffer scheme-buffer))
(scheme-interactively-start-process))
- (pop-to-buffer-same-window scheme-buffer)
+ (pop-to-buffer scheme-buffer display-comint-buffer-action)
(error "No current process buffer. See variable `scheme-buffer'"))
(when eob-p
(push-mark)
(t
(get-buffer-create eshell-buffer-name)))))
(cl-assert (and buf (buffer-live-p buf)))
- (pop-to-buffer-same-window buf)
+ (pop-to-buffer buf display-comint-buffer-action)
(unless (derived-mode-p 'eshell-mode)
(eshell-mode))
buf))
(eshell-buffer-name (car buffer-and-command))
(command (cadr buffer-and-command)))
(if (get-buffer eshell-buffer-name)
- (pop-to-buffer-same-window eshell-buffer-name)
+ (pop-to-buffer eshell-buffer-name display-comint-buffer-action)
(eshell))
(goto-char (point-max))
(eshell-kill-input)
"inferior-lisp" (car cmdlist) nil (cdr cmdlist)))
(inferior-lisp-mode)))
(setq inferior-lisp-buffer "*inferior-lisp*")
- (pop-to-buffer-same-window "*inferior-lisp*"))
+ (pop-to-buffer "*inferior-lisp*" display-comint-buffer-action))
;;;###autoload
(defalias 'run-lisp 'inferior-lisp)
(default-project-shell-name (project-prefixed-buffer-name "shell"))
(shell-buffer (get-buffer default-project-shell-name)))
(if (and shell-buffer (not current-prefix-arg))
- (pop-to-buffer-same-window shell-buffer)
+ (pop-to-buffer shell-buffer display-comint-buffer-action)
(shell (generate-new-buffer-name default-project-shell-name)))))
;;;###autoload
(eshell-buffer-name (project-prefixed-buffer-name "eshell"))
(eshell-buffer (get-buffer eshell-buffer-name)))
(if (and eshell-buffer (not current-prefix-arg))
- (pop-to-buffer-same-window eshell-buffer)
+ (pop-to-buffer eshell-buffer display-comint-buffer-action)
(eshell t))))
;;;###autoload
(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-same-window buffer)
+ (pop-to-buffer buffer)
(with-connection-local-variables
;; On remote hosts, the local `shell-file-name' might be useless.
(defun tex-display-shell ()
"Make the TeX shell buffer visible in a window."
- (display-buffer (tex-shell-buf))
+ (display-buffer (tex-shell-buf) display-comint-buffer-action)
(tex-recenter-output-buffer nil))
(defun tex-shell-sentinel (proc _msg)
(if cmds (tex-format-cmd (caar cmds) fspec))))))
(defun tex-cmd-doc-view (file)
- (pop-to-buffer (find-file-noselect file)))
+ (pop-to-buffer (find-file-noselect file) display-comint-buffer-action))
(defun tex-compile (dir cmd)
"Run a command CMD on current TeX buffer's file in DIR."
(window))
(if (null tex-shell)
(message "No TeX output buffer")
- (setq window (display-buffer tex-shell))
+ (setq window (display-buffer tex-shell display-comint-buffer-action))
(with-selected-window window
(bury-buffer tex-shell)
(goto-char (point-max))
:version "24.1"
:group 'windows)
+(defcustom display-comint-buffer-action 'display-buffer-same-window
+ "The action to display a comint buffer."
+ :type 'display-buffer--action-function-custom-type
+ :risky t
+ :version "29.1"
+ :group 'windows
+ :group 'comint)
+
(defconst display-buffer-fallback-action
'((display-buffer--maybe-same-window ;FIXME: why isn't this redundant?
display-buffer-reuse-window