aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-08-25 01:25:07 +0000
committerRichard M. Stallman1996-08-25 01:25:07 +0000
commitf73741fc2372af17f2afc213436ed6cd19017cc8 (patch)
treee82d3f2bcbf39bd72d4c2ab450c7fe0e2f65a5f2
parenta081f2023b55ab28e7071927dfdfb0e415c4c71c (diff)
downloademacs-f73741fc2372af17f2afc213436ed6cd19017cc8.tar.gz
emacs-f73741fc2372af17f2afc213436ed6cd19017cc8.zip
(tex-main-file): New variable.
(tex-file): Use that. Rename local var to source-file so it is obviously local.
-rw-r--r--lisp/textmodes/tex-mode.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 6990c80f2d6..9b5065d0b1a 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -36,12 +36,17 @@
36 36
37;;;###autoload 37;;;###autoload
38(defvar tex-directory "." 38(defvar tex-directory "."
39 "*Directory in which temporary files are left. 39 "*Directory in which temporary files are written.
40You can make this `/tmp' if your TEXINPUTS has no relative directories in it 40You can make this `/tmp' if your TEXINPUTS has no relative directories in it
41and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are 41and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are
42`\\input' commands with relative directories.") 42`\\input' commands with relative directories.")
43 43
44;;;###autoload 44;;;###autoload
45(defvar tex-main-file
46 "*The main TeX source file which includes this buffer's file.
47The command `tex-buffer' runs TeX on `tex-main-file'if that is non-nil.")
48
49;;;###autoload
45(defvar tex-offer-save t 50(defvar tex-offer-save t
46 "*If non-nil, ask about saving modified buffers before \\[tex-file] is run.") 51 "*If non-nil, ask about saving modified buffers before \\[tex-file] is run.")
47 52
@@ -1046,10 +1051,11 @@ See \\[tex-file] for an alternative."
1046This function is more useful than \\[tex-buffer] when you need the 1051This function is more useful than \\[tex-buffer] when you need the
1047`.aux' file of LaTeX to have the correct name." 1052`.aux' file of LaTeX to have the correct name."
1048 (interactive) 1053 (interactive)
1049 (let ((tex-out-file 1054 (let ((source-file
1050 (if (buffer-file-name) 1055 (or tex-main-file
1051 (file-name-nondirectory (buffer-file-name)) 1056 (if (buffer-file-name)
1052 (error "Buffer does not seem to be associated with any file"))) 1057 (file-name-nondirectory (buffer-file-name))
1058 (error "Buffer does not seem to be associated with any file"))))
1053 (file-dir (file-name-directory (buffer-file-name)))) 1059 (file-dir (file-name-directory (buffer-file-name))))
1054 (if tex-offer-save 1060 (if tex-offer-save
1055 (save-some-buffers)) 1061 (save-some-buffers))
@@ -1057,7 +1063,7 @@ This function is more useful than \\[tex-buffer] when you need the
1057 (tex-kill-job) 1063 (tex-kill-job)
1058 (tex-start-shell)) 1064 (tex-start-shell))
1059 (tex-send-command tex-shell-cd-command file-dir) 1065 (tex-send-command tex-shell-cd-command file-dir)
1060 (tex-send-command tex-command tex-out-file)) 1066 (tex-send-command tex-command source-file))
1061 (tex-display-shell) 1067 (tex-display-shell)
1062 (setq tex-last-buffer-texed (current-buffer)) 1068 (setq tex-last-buffer-texed (current-buffer))
1063 (setq tex-print-file (buffer-file-name))) 1069 (setq tex-print-file (buffer-file-name)))