From 598505c4faa7c37133223417172223356ea02e65 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 25 Apr 2024 20:34:28 +0300 Subject: [PATCH] Suppress warnings for obsolete display-comint-buffer-action (bug#69983) * 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/sh-script.el (sh-show-shell): * lisp/textmodes/tex-mode.el (tex-display-shell) (tex-recenter-output-buffer): Add 'with-suppressed-warnings' to suppress warnings for obsolete options 'display-comint-buffer-action' and 'display-tex-shell-buffer-action'. --- lisp/cmuscheme.el | 6 ++++-- lisp/eshell/eshell.el | 3 ++- lisp/progmodes/inf-lisp.el | 3 ++- lisp/progmodes/sh-script.el | 3 ++- lisp/shell.el | 3 ++- lisp/textmodes/tex-mode.el | 6 ++++-- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el index c84a1809322..d4316fb1175 100644 --- a/lisp/cmuscheme.el +++ b/lisp/cmuscheme.el @@ -238,7 +238,8 @@ is run). (inferior-scheme-mode))) (setq scheme-program-name cmd) (setq scheme-buffer "*scheme*") - (pop-to-buffer "*scheme*" display-comint-buffer-action)) + (with-suppressed-warnings ((obsolete display-comint-buffer-action)) + (pop-to-buffer "*scheme*" display-comint-buffer-action))) (defun scheme-start-file (prog) "Return the name of the start file corresponding to PROG. @@ -358,7 +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)) - (pop-to-buffer scheme-buffer display-comint-buffer-action) + (with-suppressed-warnings ((obsolete display-comint-buffer-action)) + (pop-to-buffer scheme-buffer display-comint-buffer-action)) (error "No current process buffer. See variable `scheme-buffer'")) (when eob-p (push-mark) diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 7d374587dc4..503f64add41 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -250,7 +250,8 @@ information on Eshell, see Info node `(eshell)Top'." (t (get-buffer-create eshell-buffer-name))))) (cl-assert (and buf (buffer-live-p buf))) - (pop-to-buffer buf display-comint-buffer-action) + (with-suppressed-warnings ((obsolete display-comint-buffer-action)) + (pop-to-buffer buf display-comint-buffer-action)) (unless (derived-mode-p 'eshell-mode) (eshell-mode)) buf)) diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 141bd18cf1e..687b176009e 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -308,7 +308,8 @@ quoted using shell quote syntax. "inferior-lisp" (car cmdlist) nil (cdr cmdlist))) (inferior-lisp-mode))) (setq inferior-lisp-buffer "*inferior-lisp*") - (pop-to-buffer "*inferior-lisp*" display-comint-buffer-action)) + (with-suppressed-warnings ((obsolete display-comint-buffer-action)) + (pop-to-buffer "*inferior-lisp*" display-comint-buffer-action))) ;;;###autoload (defalias 'run-lisp 'inferior-lisp) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 20c9e00edbf..a348e9ba6fd 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1435,7 +1435,8 @@ If FORCE is non-nil and no process found, create one." (defun sh-show-shell () "Pop the shell interaction buffer." (interactive) - (pop-to-buffer (process-buffer (sh-shell-process t)) display-comint-buffer-action)) + (with-suppressed-warnings ((obsolete display-comint-buffer-action)) + (pop-to-buffer (process-buffer (sh-shell-process t)) display-comint-buffer-action))) (defun sh-send-text (text) "Send TEXT to `sh-shell-process'." diff --git a/lisp/shell.el b/lisp/shell.el index cd49d289403..e6b315ee5c0 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -923,7 +923,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). - (pop-to-buffer buffer display-comint-buffer-action) + (with-suppressed-warnings ((obsolete display-comint-buffer-action)) + (pop-to-buffer buffer display-comint-buffer-action)) (with-connection-local-variables (when file-name diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 02ee1242c72..97c950267c6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2035,7 +2035,8 @@ 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." - (display-buffer (tex-shell-buf) display-tex-shell-buffer-action) + (with-suppressed-warnings ((obsolete display-tex-shell-buffer-action)) + (display-buffer (tex-shell-buf) display-tex-shell-buffer-action)) (tex-recenter-output-buffer nil)) (defun tex-shell-sentinel (proc _msg) @@ -2692,7 +2693,8 @@ line LINE of the window, or centered if LINE is nil." (if (null tex-shell) (message "No TeX output buffer") (when-let ((window - (display-buffer tex-shell display-tex-shell-buffer-action))) + (with-suppressed-warnings ((obsolete display-tex-shell-buffer-action)) + (display-buffer tex-shell display-tex-shell-buffer-action)))) (with-selected-window window (bury-buffer tex-shell) (goto-char (point-max))