comparison lisp/textmodes/tex-mode.el @ 10572:c8717227f621

(tex-display-shell): Pass nil as arg to tex-recenter-output-buffer. (tex-region, tex-file, tex-show-print-queue, tex-bibtex-file): Put the call to tex-display-shell essentially last.
author Richard M. Stallman <rms@gnu.org>
date Fri, 27 Jan 1995 23:08:49 +0000
parents f27bcd1faf07
children ace814499178
comparison
equal deleted inserted replaced
10571:0bd8034a4f54 10572:c8717227f621
830 (setq tex-shell-map (nconc (make-sparse-keymap) shell-mode-map)) 830 (setq tex-shell-map (nconc (make-sparse-keymap) shell-mode-map))
831 (tex-define-common-keys tex-shell-map) 831 (tex-define-common-keys tex-shell-map)
832 (use-local-map tex-shell-map) 832 (use-local-map tex-shell-map)
833 (run-hooks 'tex-shell-hook) 833 (run-hooks 'tex-shell-hook)
834 (while (zerop (buffer-size)) 834 (while (zerop (buffer-size))
835 (sleep-for 1))))) 835 (sleep-for 1)))))
836
837 (defun tex-display-shell ()
838 "Make the TeX shell buffer visible in a window."
839 (display-buffer (process-buffer (get-process "tex-shell")))
840 (tex-recenter-output-buffer nil))
836 841
837 (defun tex-shell-sentinel (proc msg) 842 (defun tex-shell-sentinel (proc msg)
838 (cond ((null (buffer-name (process-buffer proc))) 843 (cond ((null (buffer-name (process-buffer proc)))
839 ;; buffer killed 844 ;; buffer killed
840 (set-process-buffer proc nil) 845 (set-process-buffer proc nil)
920 The value of `tex-command' specifies the command to use to run TeX." 925 The value of `tex-command' specifies the command to use to run TeX."
921 (interactive "r") 926 (interactive "r")
922 (if (tex-shell-running) 927 (if (tex-shell-running)
923 (tex-kill-job) 928 (tex-kill-job)
924 (tex-start-shell)) 929 (tex-start-shell))
925 (display-buffer (process-buffer (get-process "tex-shell")))
926 (or tex-zap-file 930 (or tex-zap-file
927 (setq tex-zap-file (tex-generate-zap-file-name))) 931 (setq tex-zap-file (tex-generate-zap-file-name)))
928 (let* ((temp-buffer (get-buffer-create " TeX-Output-Buffer")) 932 (let* ((temp-buffer (get-buffer-create " TeX-Output-Buffer"))
929 ; Temp file will be written and TeX will be run in zap-directory. 933 ; Temp file will be written and TeX will be run in zap-directory.
930 ; If the TEXINPUTS file has relative directories or if the region has 934 ; If the TEXINPUTS file has relative directories or if the region has
970 (concat tex-out-file ".tex") t nil)))) 974 (concat tex-out-file ".tex") t nil))))
971 ;; Record the file name to be deleted afterward. 975 ;; Record the file name to be deleted afterward.
972 (setq tex-last-temp-file tex-out-file) 976 (setq tex-last-temp-file tex-out-file)
973 (tex-send-command tex-shell-cd-command zap-directory) 977 (tex-send-command tex-shell-cd-command zap-directory)
974 (tex-send-command tex-command tex-out-file) 978 (tex-send-command tex-command tex-out-file)
979 (tex-display-shell)
975 (setq tex-print-file tex-out-file) 980 (setq tex-print-file tex-out-file)
976 (setq tex-last-buffer-texed (current-buffer)))) 981 (setq tex-last-buffer-texed (current-buffer))))
977 982
978 (defun tex-buffer () 983 (defun tex-buffer ()
979 "Run TeX on current buffer. See \\[tex-region] for more information. 984 "Run TeX on current buffer. See \\[tex-region] for more information.
995 (if tex-offer-save 1000 (if tex-offer-save
996 (save-some-buffers)) 1001 (save-some-buffers))
997 (if (tex-shell-running) 1002 (if (tex-shell-running)
998 (tex-kill-job) 1003 (tex-kill-job)
999 (tex-start-shell)) 1004 (tex-start-shell))
1000 (display-buffer (process-buffer (get-process "tex-shell")))
1001 (tex-send-command tex-shell-cd-command file-dir) 1005 (tex-send-command tex-shell-cd-command file-dir)
1002 (tex-send-command tex-command tex-out-file)) 1006 (tex-send-command tex-command tex-out-file))
1007 (tex-display-shell)
1003 (setq tex-last-buffer-texed (current-buffer)) 1008 (setq tex-last-buffer-texed (current-buffer))
1004 (setq tex-print-file (buffer-file-name))) 1009 (setq tex-print-file (buffer-file-name)))
1005 1010
1006 (defun tex-generate-zap-file-name () 1011 (defun tex-generate-zap-file-name ()
1007 "Generate a unique name suitable for use as a file name." 1012 "Generate a unique name suitable for use as a file name."
1117 Runs the shell command defined by `tex-show-queue-command'." 1122 Runs the shell command defined by `tex-show-queue-command'."
1118 (interactive) 1123 (interactive)
1119 (if (tex-shell-running) 1124 (if (tex-shell-running)
1120 (tex-kill-job) 1125 (tex-kill-job)
1121 (tex-start-shell)) 1126 (tex-start-shell))
1122 (display-buffer (process-buffer (get-process "tex-shell"))) 1127 (tex-send-command tex-show-queue-command)
1123 (tex-send-command tex-show-queue-command)) 1128 (tex-display-shell))
1124 1129
1125 (defun tex-bibtex-file () 1130 (defun tex-bibtex-file ()
1126 "Run BibTeX on the current buffer's file." 1131 "Run BibTeX on the current buffer's file."
1127 (interactive) 1132 (interactive)
1128 (if (tex-shell-running) 1133 (if (tex-shell-running)
1129 (tex-kill-job) 1134 (tex-kill-job)
1130 (tex-start-shell)) 1135 (tex-start-shell))
1131 (display-buffer (process-buffer (get-process "tex-shell")))
1132 (let ((tex-out-file 1136 (let ((tex-out-file
1133 (tex-append (file-name-nondirectory (buffer-file-name)) "")) 1137 (tex-append (file-name-nondirectory (buffer-file-name)) ""))
1134 (file-dir (file-name-directory (buffer-file-name)))) 1138 (file-dir (file-name-directory (buffer-file-name))))
1135 (tex-send-command tex-shell-cd-command file-dir) 1139 (tex-send-command tex-shell-cd-command file-dir)
1136 (tex-send-command tex-bibtex-command tex-out-file))) 1140 (tex-send-command tex-bibtex-command tex-out-file))
1141 (tex-display-shell))
1137 1142
1138 (run-hooks 'tex-mode-load-hook) 1143 (run-hooks 'tex-mode-load-hook)
1139 1144
1140 (provide 'tex-mode) 1145 (provide 'tex-mode)
1141 1146