changeset 58696:35f8fcf3abca

(tex-main-file): Add a compatibility with AUCTeX.
author Markus Rost <rost@math.uni-bielefeld.de>
date Wed, 01 Dec 2004 04:08:15 +0000
parents b742505dc5c4
children 5deed09aa3c9
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Wed Dec 01 00:35:37 2004 +0000
+++ b/lisp/textmodes/tex-mode.el	Wed Dec 01 04:08:15 2004 +0000
@@ -1693,9 +1693,12 @@
   (let* ((file (or tex-main-file
 		   ;; Compatibility with AUCTeX.
 		   (with-no-warnings
-		    (when (and (boundp 'TeX-master) (stringp TeX-master))
-		      (make-local-variable 'tex-main-file)
-		      (setq tex-main-file TeX-master)))
+		    (when (boundp 'TeX-master)
+		      (cond ((stringp TeX-master)
+			     (make-local-variable 'tex-main-file)
+			     (setq tex-main-file TeX-master))
+			    ((and (eq TeX-master t) buffer-file-name)
+			     (file-relative-name buffer-file-name)))))
 		   ;; Try to guess the main file.
 		   (if (not buffer-file-name)
 		       (error "Buffer is not associated with any file")