Function: TeX-run-TeX

TeX-run-TeX is a byte-compiled function defined in tex.el.

Signature

(TeX-run-TeX NAME COMMAND FILE)

Documentation

Create a process for NAME using COMMAND to format FILE with TeX.

Aliases

TeX-run-LaTeX

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-run-TeX (name command file)
  "Create a process for NAME using COMMAND to format FILE with TeX."

  (let ((idx-file nil) (element nil))
    ;; Store md5 hash of the index file before running LaTeX.
    (and (memq major-mode '(docTeX-mode LaTeX-mode))
         (prog1 (file-exists-p
                 (setq idx-file (expand-file-name (TeX-active-master "idx"))))
           ;; In order to avoid confusion and pollution of
           ;; `LaTeX-idx-md5-alist', remove from this alist all md5 hashes of
           ;; the current index file.  Note `assq-delete-all' doesn't work with
           ;; string keys and has problems with non-list elements in Emacs 21
           ;; (see file tex-site.el).
           (while (setq element (assoc idx-file LaTeX-idx-md5-alist))
             (setq LaTeX-idx-md5-alist (delq element LaTeX-idx-md5-alist))))
         (with-temp-buffer
           (insert-file-contents-literally idx-file)
           (push (cons idx-file (md5 (current-buffer))) LaTeX-idx-md5-alist))))

  ;; can we assume that TeX-sentinel-function will not be changed
  ;; during (TeX-run-format ..)? --pg
  ;; rather use let* ? --pg

  (if TeX-interactive-mode
      (TeX-run-interactive name command file)
    (let* ((sentinel-function TeX-sentinel-default-function)
           (process (TeX-run-format name command file)))
      (setq TeX-sentinel-function sentinel-function)
      (if TeX-process-asynchronous
          process
        (TeX-synchronous-sentinel name file process)))))