(use-local-map tex-shell-map)
(run-hooks 'tex-shell-hook)
(while (zerop (buffer-size))
- (sleep-for 1)))))
+ (sleep-for 1)))))
+
+(defun tex-display-shell ()
+ "Make the TeX shell buffer visible in a window."
+ (display-buffer (process-buffer (get-process "tex-shell")))
+ (tex-recenter-output-buffer nil))
(defun tex-shell-sentinel (proc msg)
(cond ((null (buffer-name (process-buffer proc)))
(if (tex-shell-running)
(tex-kill-job)
(tex-start-shell))
- (display-buffer (process-buffer (get-process "tex-shell")))
(or tex-zap-file
(setq tex-zap-file (tex-generate-zap-file-name)))
(let* ((temp-buffer (get-buffer-create " TeX-Output-Buffer"))
(setq tex-last-temp-file tex-out-file)
(tex-send-command tex-shell-cd-command zap-directory)
(tex-send-command tex-command tex-out-file)
+ (tex-display-shell)
(setq tex-print-file tex-out-file)
(setq tex-last-buffer-texed (current-buffer))))
(if (tex-shell-running)
(tex-kill-job)
(tex-start-shell))
- (display-buffer (process-buffer (get-process "tex-shell")))
(tex-send-command tex-shell-cd-command file-dir)
(tex-send-command tex-command tex-out-file))
+ (tex-display-shell)
(setq tex-last-buffer-texed (current-buffer))
(setq tex-print-file (buffer-file-name)))
(if (tex-shell-running)
(tex-kill-job)
(tex-start-shell))
- (display-buffer (process-buffer (get-process "tex-shell")))
- (tex-send-command tex-show-queue-command))
+ (tex-send-command tex-show-queue-command)
+ (tex-display-shell))
(defun tex-bibtex-file ()
"Run BibTeX on the current buffer's file."
(if (tex-shell-running)
(tex-kill-job)
(tex-start-shell))
- (display-buffer (process-buffer (get-process "tex-shell")))
(let ((tex-out-file
(tex-append (file-name-nondirectory (buffer-file-name)) ""))
(file-dir (file-name-directory (buffer-file-name))))
(tex-send-command tex-shell-cd-command file-dir)
- (tex-send-command tex-bibtex-command tex-out-file)))
+ (tex-send-command tex-bibtex-command tex-out-file))
+ (tex-display-shell))
(run-hooks 'tex-mode-load-hook)