comparison lisp/textmodes/tex-mode.el @ 5088:73a1b31b673f

(tex-send-command): Wait for output first, if text has not changed since previous tex-send-command. (tex-send-command-modified-tick): New buffer-local variable.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Nov 1993 22:21:30 +0000
parents a7b2df620d1a
children b3a689b41d39
comparison
equal deleted inserted replaced
5087:a7b2df620d1a 5088:73a1b31b673f
789 (error "%s is not a directory" directory) 789 (error "%s is not a directory" directory)
790 (save-excursion 790 (save-excursion
791 (set-buffer buffer) 791 (set-buffer buffer)
792 (setq default-directory directory)))) 792 (setq default-directory directory))))
793 793
794 (defvar tex-send-command-modified-tick 0)
795 (make-variable-buffer-local 'tex-send-command-modified-tick)
796
794 (defun tex-send-command (command &optional file background) 797 (defun tex-send-command (command &optional file background)
795 "Send COMMAND to TeX shell process, substituting optional FILE for *. 798 "Send COMMAND to TeX shell process, substituting optional FILE for *.
796 Do this in background if optional BACKGROUND is t. If COMMAND has no *, 799 Do this in background if optional BACKGROUND is t. If COMMAND has no *,
797 FILE will be appended, preceded by a blank, to COMMAND. If FILE is nil, no 800 FILE will be appended, preceded by a blank, to COMMAND. If FILE is nil, no
798 substitution will be made in COMMAND. COMMAND can be any expression that 801 substitution will be made in COMMAND. COMMAND can be any expression that
807 (if star (concat (substring cmd 0 star) 810 (if star (concat (substring cmd 0 star)
808 file (substring cmd (1+ star))) 811 file (substring cmd (1+ star)))
809 (concat cmd " " file)) 812 (concat cmd " " file))
810 cmd) 813 cmd)
811 (if background "&" "")))) 814 (if background "&" ""))))
815 ;; If text is unchanged since previous tex-send-command,
816 ;; we haven't got any output. So wait for output now.
817 (if (= (buffer-modified-tick) tex-send-command-modified-tick)
818 (accept-process-output proc))
812 (set-buffer (process-buffer proc)) 819 (set-buffer (process-buffer proc))
813 (goto-char (process-mark proc)) 820 (goto-char (process-mark proc))
814 (insert string) 821 (insert string)
815 (comint-send-input)))) 822 (comint-send-input)
823 (setq tex-send-command-modified-tick (buffer-modified-tick)))))
816 824
817 (defun tex-delete-last-temp-files () 825 (defun tex-delete-last-temp-files ()
818 "Delete any junk files from last temp file." 826 "Delete any junk files from last temp file."
819 (if tex-last-temp-file 827 (if tex-last-temp-file
820 (let* ((dir (file-name-directory tex-last-temp-file)) 828 (let* ((dir (file-name-directory tex-last-temp-file))