summaryrefslogtreecommitdiff
path: root/lisp/textmodes/tex-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes/tex-mode.el')
-rw-r--r--lisp/textmodes/tex-mode.el26
1 files changed, 14 insertions, 12 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 953073d2833..4f19edcdc2f 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1063,10 +1063,10 @@ This function is more useful than \\[tex-buffer] when you need the
(tex-kill-job)
(tex-start-shell))
(tex-send-command tex-shell-cd-command file-dir)
- (tex-send-command tex-command source-file))
- (tex-display-shell)
- (setq tex-last-buffer-texed (current-buffer))
- (setq tex-print-file source-file))
+ (tex-send-command tex-command source-file)
+ (tex-display-shell)
+ (setq tex-last-buffer-texed (current-buffer))
+ (setq tex-print-file source-file)))
(defun tex-generate-zap-file-name ()
"Generate a unique name suitable for use as a file name."
@@ -1108,16 +1108,18 @@ The last line of the buffer is displayed on
line LINE of the window, or centered if LINE is nil."
(interactive "P")
(let ((tex-shell (get-buffer "*tex-shell*"))
- (old-buffer (current-buffer)))
+ (old-buffer (current-buffer))
+ (window))
(if (null tex-shell)
(message "No TeX output buffer")
- (pop-to-buffer tex-shell)
- (bury-buffer tex-shell)
- (goto-char (point-max))
- (recenter (if linenum
- (prefix-numeric-value linenum)
- (/ (window-height) 2)))
- (pop-to-buffer old-buffer))))
+ (setq window (display-buffer tex-shell))
+ (save-selected-window
+ (select-window window)
+ (bury-buffer tex-shell)
+ (goto-char (point-max))
+ (recenter (if linenum
+ (prefix-numeric-value linenum)
+ (/ (window-height) 2)))))))
(defun tex-print (&optional alt)
"Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file].