Skip to content

Commit

Permalink
Remove obsolete 'display-comint-buffer-action' (bug#74361)
Browse files Browse the repository at this point in the history
* lisp/window.el (display-comint-buffer-action):
(display-tex-shell-buffer-action):
Remove obsolete defcustoms.

* lisp/cmuscheme.el (run-scheme, switch-to-scheme):
* lisp/shell.el (shell):
* lisp/eshell/eshell.el (eshell):
* lisp/progmodes/inf-lisp.el (inferior-lisp):
* lisp/progmodes/project.el (project-shell, project-eshell):
* lisp/progmodes/sh-script.el (sh-show-shell):
Replace 'display-comint-buffer-action' with a list of
'display-buffer--same-window-action' and '(category . comint)'.

* lisp/org/ol-eshell.el (org-eshell-open): Add '(category . comint)'.

* lisp/textmodes/tex-mode.el (tex-display-shell)
(tex-recenter-output-buffer):
Replace 'display-tex-shell-buffer-action' with a list of
'display-buffer-in-previous-window' and '(category . tex-shell)'.
  • Loading branch information
link0ff committed Dec 4, 2024
1 parent 69e1f78 commit d706be4
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 49 deletions.
6 changes: 6 additions & 0 deletions etc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ that the actual killing or burying of the buffer is done by the caller.
With this option set, 'quit-restore-window' will delete its window more
aggressively rather than switching to some other buffer in it.

---
*** The user option 'display-comint-buffer-action' has been removed.
It has been obsolete since Emacs 30.1. Use '(category . comint)' instead.
Another user option 'display-tex-shell-buffer-action' has been removed too
for which you can use '(category . tex-shell)'.

** Frames

+++
Expand Down
8 changes: 4 additions & 4 deletions lisp/cmuscheme.el
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ is run).
(inferior-scheme-mode)))
(setq scheme-program-name cmd)
(setq scheme-buffer "*scheme*")
(with-suppressed-warnings ((obsolete display-comint-buffer-action))
(pop-to-buffer "*scheme*" display-comint-buffer-action)))
(pop-to-buffer "*scheme*" (append display-buffer--same-window-action
'((category . comint)))))

(defun scheme-start-file (prog)
"Return the name of the start file corresponding to PROG.
Expand Down Expand Up @@ -359,8 +359,8 @@ With argument, position cursor at end of buffer."
(interactive "P")
(if (or (and scheme-buffer (get-buffer scheme-buffer))
(scheme-interactively-start-process))
(with-suppressed-warnings ((obsolete display-comint-buffer-action))
(pop-to-buffer scheme-buffer display-comint-buffer-action))
(pop-to-buffer scheme-buffer (append display-buffer--same-window-action
'((category . comint))))
(error "No current process buffer. See variable `scheme-buffer'"))
(when eob-p
(push-mark)
Expand Down
4 changes: 2 additions & 2 deletions lisp/eshell/eshell.el
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ information on Eshell, see Info node `(eshell)Top'."
(t
(get-buffer-create eshell-buffer-name)))))
(cl-assert (and buf (buffer-live-p buf)))
(with-suppressed-warnings ((obsolete display-comint-buffer-action))
(pop-to-buffer buf display-comint-buffer-action))
(pop-to-buffer buf (append display-buffer--same-window-action
'((category . comint))))
(unless (derived-mode-p 'eshell-mode)
(eshell-mode))
buf))
Expand Down
4 changes: 2 additions & 2 deletions lisp/org/ol-eshell.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ followed by a colon."
(if (get-buffer eshell-buffer-name)
(pop-to-buffer
eshell-buffer-name
(if (boundp 'display-comint-buffer-action) ; Emacs >= 29
(if (boundp 'display-comint-buffer-action) ; Emacs >= 29, <= 30
display-comint-buffer-action
'(display-buffer-same-window (inhibit-same-window))))
'(display-buffer-same-window (inhibit-same-window) (category . comint))))
(eshell))
(goto-char (point-max))
(eshell-kill-input)
Expand Down
4 changes: 2 additions & 2 deletions lisp/progmodes/inf-lisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ quoted using shell quote syntax.
"inferior-lisp" (car cmdlist) nil (cdr cmdlist)))
(inferior-lisp-mode)))
(setq inferior-lisp-buffer "*inferior-lisp*")
(with-suppressed-warnings ((obsolete display-comint-buffer-action))
(pop-to-buffer "*inferior-lisp*" display-comint-buffer-action)))
(pop-to-buffer "*inferior-lisp*" (append display-buffer--same-window-action
'((category . comint)))))

;;;###autoload
(defalias 'run-lisp 'inferior-lisp)
Expand Down
6 changes: 4 additions & 2 deletions lisp/progmodes/project.el
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,8 @@ if one already exists."
(shell-buffer (get-buffer default-project-shell-name)))
(if (and shell-buffer (not current-prefix-arg))
(if (comint-check-proc shell-buffer)
(pop-to-buffer shell-buffer (bound-and-true-p display-comint-buffer-action))
(pop-to-buffer shell-buffer (append display-buffer--same-window-action
'((category . comint))))
(shell shell-buffer))
(shell (generate-new-buffer-name default-project-shell-name)))))

Expand All @@ -1393,7 +1394,8 @@ if one already exists."
(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 eshell-buffer (bound-and-true-p display-comint-buffer-action))
(pop-to-buffer eshell-buffer (append display-buffer--same-window-action
'((category . comint))))
(eshell t))))

;;;###autoload
Expand Down
5 changes: 3 additions & 2 deletions lisp/progmodes/sh-script.el
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,9 @@ If FORCE is non-nil and no process found, create one."
(defun sh-show-shell ()
"Pop the shell interaction buffer."
(interactive)
(with-suppressed-warnings ((obsolete display-comint-buffer-action))
(pop-to-buffer (process-buffer (sh-shell-process t)) display-comint-buffer-action)))
(pop-to-buffer (process-buffer (sh-shell-process t))
(append display-buffer--same-window-action
'((category . comint)))))

(defun sh-send-text (text)
"Send TEXT to `sh-shell-process'."
Expand Down
4 changes: 2 additions & 2 deletions lisp/shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,8 @@ 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).
(with-suppressed-warnings ((obsolete display-comint-buffer-action))
(pop-to-buffer buffer display-comint-buffer-action))
(pop-to-buffer buffer (append display-buffer--same-window-action
'((category . comint))))

(with-connection-local-variables
(when file-name
Expand Down
10 changes: 6 additions & 4 deletions lisp/textmodes/tex-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2092,8 +2092,9 @@ In the tex shell buffer this command behaves like `comint-send-input'."

(defun tex-display-shell ()
"Make the TeX shell buffer visible in a window."
(with-suppressed-warnings ((obsolete display-tex-shell-buffer-action))
(display-buffer (tex-shell-buf) display-tex-shell-buffer-action))
(display-buffer (tex-shell-buf) '(display-buffer-in-previous-window
(inhibit-same-window . t)
(category . tex-shell)))
(tex-recenter-output-buffer nil))

(defun tex-shell-sentinel (proc _msg)
Expand Down Expand Up @@ -2753,8 +2754,9 @@ line LINE of the window, or centered if LINE is nil."
(if (null tex-shell)
(message "No TeX output buffer")
(when-let* ((window
(with-suppressed-warnings ((obsolete display-tex-shell-buffer-action))
(display-buffer tex-shell display-tex-shell-buffer-action))))
(display-buffer tex-shell '(display-buffer-in-previous-window
(inhibit-same-window . t)
(category . tex-shell)))))
(with-selected-window window
(bury-buffer tex-shell)
(goto-char (point-max))
Expand Down
29 changes: 0 additions & 29 deletions lisp/window.el
Original file line number Diff line number Diff line change
Expand Up @@ -9115,35 +9115,6 @@ currently selected window; otherwise it will be displayed in
another window."
(pop-to-buffer buffer display-buffer--same-window-action norecord))

(defcustom display-comint-buffer-action
(append display-buffer--same-window-action '((category . comint)))
"`display-buffer' action for displaying comint buffers."
:type display-buffer--action-custom-type
:risky t
:version "29.1"
:group 'windows
:group 'comint)

(make-obsolete-variable
'display-comint-buffer-action
"use a `(category . comint)' condition in `display-buffer-alist'."
"30.1")

(defcustom display-tex-shell-buffer-action '(display-buffer-in-previous-window
(inhibit-same-window . t)
(category . tex-shell))
"`display-buffer' action for displaying TeX shell buffers."
:type display-buffer--action-custom-type
:risky t
:version "29.1"
:group 'windows
:group 'tex-run)

(make-obsolete-variable
'display-tex-shell-buffer-action
"use a `(category . tex-shell)' condition in `display-buffer-alist'."
"30.1")

(defun read-buffer-to-switch (prompt)
"Read the name of a buffer to switch to, prompting with PROMPT.
Return the name of the buffer as a string.
Expand Down

0 comments on commit d706be4

Please # to comment.