summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-06-11 09:15:01 +0300
committerEli Zaretskii <eliz@gnu.org>2023-06-11 09:15:01 +0300
commitbdb0bc2b4e44a7d40369e10e3de825d58fe46825 (patch)
treec4c0448543c4449922668b952ef12096e165a0c6
parent90047c38ce98af4ac7d0fa9d59ba0d668e4ae902 (diff)
downloademacs-bdb0bc2b4e44a7d40369e10e3de825d58fe46825.tar.gz
Fix tex-mode display-buffer issues
* lisp/window.el (display-tex-shell-buffer-action): New defcustom. * lisp/textmodes/tex-mode.el (tex-display-shell) (tex-cmd-doc-view, tex-recenter-output-buffer): Use it. (Bug#63956)
-rw-r--r--lisp/textmodes/tex-mode.el6
-rw-r--r--lisp/window.el8
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index fcb01fb6c08..44984697e70 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -2025,7 +2025,7 @@ 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-comint-buffer-action)
+ (display-buffer (tex-shell-buf) display-tex-shell-buffer-action)
(tex-recenter-output-buffer nil))
(defun tex-shell-sentinel (proc _msg)
@@ -2426,7 +2426,7 @@ Only applies the FSPEC to the args part of FORMAT."
(if cmds (tex-format-cmd (caar cmds) fspec))))))
(defun tex-cmd-doc-view (file)
- (pop-to-buffer (find-file-noselect file) display-comint-buffer-action))
+ (pop-to-buffer (find-file-noselect file) display-tex-shell-buffer-action))
(defun tex-compile (dir cmd)
"Run a command CMD on current TeX buffer's file in DIR."
@@ -2681,7 +2681,7 @@ line LINE of the window, or centered if LINE is nil."
(window))
(if (null tex-shell)
(message "No TeX output buffer")
- (setq window (display-buffer tex-shell display-comint-buffer-action))
+ (setq window (display-buffer tex-shell display-tex-shell-buffer-action))
(with-selected-window window
(bury-buffer tex-shell)
(goto-char (point-max))
diff --git a/lisp/window.el b/lisp/window.el
index a11b1a51f8f..78b0787abdb 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8776,6 +8776,14 @@ another window."
:group 'windows
:group 'comint)
+(defcustom display-tex-shell-buffer-action 'display-buffer-in-previous-window
+ "`display-buffer' action for displaying TeX shell buffers."
+ :type display-buffer--action-custom-type
+ :risky t
+ :version "29.1"
+ :group 'windows
+ :group 'tex-run)
+
(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.