diff options
| author | Eshel Yaron | 2023-09-05 18:58:02 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-09-06 19:37:38 +0300 |
| commit | bc56da92d8df806ff9ec66be70920d98e0ef5b42 (patch) | |
| tree | a676934753406da3181fc9886940aaf55e84caff | |
| parent | d17c5adc05785f7c5b37f82979d10bdf5f1c2886 (diff) | |
| download | emacs-bc56da92d8df806ff9ec66be70920d98e0ef5b42.tar.gz emacs-bc56da92d8df806ff9ec66be70920d98e0ef5b42.zip | |
; Fix error in 'tex-recenter-output-buffer'
* lisp/textmodes/tex-mode.el (tex-recenter-output-buffer): Check
that 'display-buffer' returned a window, rather than nil, before
selecting it. (Bug#65762)
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 294c9792f39..c33a5997070 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -2677,17 +2677,17 @@ This function is more useful than \\[tex-buffer] when you need the | |||
| 2677 | The last line of the buffer is displayed on | 2677 | The last line of the buffer is displayed on |
| 2678 | line LINE of the window, or centered if LINE is nil." | 2678 | line LINE of the window, or centered if LINE is nil." |
| 2679 | (interactive "P") | 2679 | (interactive "P") |
| 2680 | (let ((tex-shell (get-buffer "*tex-shell*")) | 2680 | (let ((tex-shell (get-buffer "*tex-shell*"))) |
| 2681 | (window)) | ||
| 2682 | (if (null tex-shell) | 2681 | (if (null tex-shell) |
| 2683 | (message "No TeX output buffer") | 2682 | (message "No TeX output buffer") |
| 2684 | (setq window (display-buffer tex-shell display-tex-shell-buffer-action)) | 2683 | (when-let ((window |
| 2685 | (with-selected-window window | 2684 | (display-buffer tex-shell display-tex-shell-buffer-action))) |
| 2686 | (bury-buffer tex-shell) | 2685 | (with-selected-window window |
| 2687 | (goto-char (point-max)) | 2686 | (bury-buffer tex-shell) |
| 2688 | (recenter (if linenum | 2687 | (goto-char (point-max)) |
| 2689 | (prefix-numeric-value linenum) | 2688 | (recenter (if linenum |
| 2690 | (/ (window-height) 2))))))) | 2689 | (prefix-numeric-value linenum) |
| 2690 | (/ (window-height) 2)))))))) | ||
| 2691 | 2691 | ||
| 2692 | (defcustom tex-print-file-extension ".dvi" | 2692 | (defcustom tex-print-file-extension ".dvi" |
| 2693 | "The TeX-compiled file extension for viewing and printing. | 2693 | "The TeX-compiled file extension for viewing and printing. |