diff options
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index a7b2d8e8f81..ca345f8b635 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1651,8 +1651,10 @@ of the current buffer." | |||
| 1651 | "Return the relative name of the main file." | 1651 | "Return the relative name of the main file." |
| 1652 | (let* ((file (or tex-main-file | 1652 | (let* ((file (or tex-main-file |
| 1653 | ;; Compatibility with AUCTeX. | 1653 | ;; Compatibility with AUCTeX. |
| 1654 | (and (boundp 'TeX-master) (stringp TeX-master) | 1654 | (with-no-warnings |
| 1655 | (set (make-local-variable 'tex-main-file) TeX-master)) | 1655 | (when (and (boundp 'TeX-master) (stringp TeX-master)) |
| 1656 | (make-local-variable 'tex-main-file) | ||
| 1657 | (setq tex-main-file TeX-master))) | ||
| 1656 | ;; Try to guess the main file. | 1658 | ;; Try to guess the main file. |
| 1657 | (if (not buffer-file-name) | 1659 | (if (not buffer-file-name) |
| 1658 | (error "Buffer is not associated with any file") | 1660 | (error "Buffer is not associated with any file") |