Commit f73741fc authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(tex-main-file): New variable.

(tex-file): Use that.  Rename local var to source-file
so it is obviously local.
parent a081f202
...@@ -36,11 +36,16 @@ ...@@ -36,11 +36,16 @@
;;;###autoload ;;;###autoload
(defvar tex-directory "." (defvar tex-directory "."
"*Directory in which temporary files are left. "*Directory in which temporary files are written.
You can make this `/tmp' if your TEXINPUTS has no relative directories in it You can make this `/tmp' if your TEXINPUTS has no relative directories in it
and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are
`\\input' commands with relative directories.") `\\input' commands with relative directories.")
;;;###autoload
(defvar tex-main-file
"*The main TeX source file which includes this buffer's file.
The command `tex-buffer' runs TeX on `tex-main-file'if that is non-nil.")
;;;###autoload ;;;###autoload
(defvar tex-offer-save t (defvar tex-offer-save t
"*If non-nil, ask about saving modified buffers before \\[tex-file] is run.") "*If non-nil, ask about saving modified buffers before \\[tex-file] is run.")
...@@ -1046,10 +1051,11 @@ See \\[tex-file] for an alternative." ...@@ -1046,10 +1051,11 @@ See \\[tex-file] for an alternative."
This function is more useful than \\[tex-buffer] when you need the This function is more useful than \\[tex-buffer] when you need the
`.aux' file of LaTeX to have the correct name." `.aux' file of LaTeX to have the correct name."
(interactive) (interactive)
(let ((tex-out-file (let ((source-file
(if (buffer-file-name) (or tex-main-file
(file-name-nondirectory (buffer-file-name)) (if (buffer-file-name)
(error "Buffer does not seem to be associated with any file"))) (file-name-nondirectory (buffer-file-name))
(error "Buffer does not seem to be associated with any file"))))
(file-dir (file-name-directory (buffer-file-name)))) (file-dir (file-name-directory (buffer-file-name))))
(if tex-offer-save (if tex-offer-save
(save-some-buffers)) (save-some-buffers))
...@@ -1057,7 +1063,7 @@ This function is more useful than \\[tex-buffer] when you need the ...@@ -1057,7 +1063,7 @@ This function is more useful than \\[tex-buffer] when you need the
(tex-kill-job) (tex-kill-job)
(tex-start-shell)) (tex-start-shell))
(tex-send-command tex-shell-cd-command file-dir) (tex-send-command tex-shell-cd-command file-dir)
(tex-send-command tex-command tex-out-file)) (tex-send-command tex-command source-file))
(tex-display-shell) (tex-display-shell)
(setq tex-last-buffer-texed (current-buffer)) (setq tex-last-buffer-texed (current-buffer))
(setq tex-print-file (buffer-file-name))) (setq tex-print-file (buffer-file-name)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment